C でファイルから読み取るときに、どのようにトークン化しますか?
テキストファイル:
PES 2009;コナミ;DVD 3;500.25; 6
アサシン クリード;Ubisoft;DVD;598.25; 3
インフェルノ;EA;DVD 2;650.25; 7
char *tokenPtr;
fileT = fopen("DATA2.txt", "r"); /* this will not work */
tokenPtr = strtok(fileT, ";");
while(tokenPtr != NULL ) {
printf("%s\n", tokenPtr);
tokenPtr = strtok(NULL, ";");
}
印刷したい:
ウイイレ2009
コナミ
.
.
.