[Objective-C]ファイルを介して間接的に文字列を読む方法

コード下記:
#inport<Foundation/Foundation.h>
int main(int argc, char *argv[])
{
FILE *wordFile = fopen(“/tmp/words_startnews24.txt", “r");
char word[100];

while(fgets(word, 100, wordFile))
{
word[strlen(word) – 1] = '\0’;

NSLog(@"%s is %lu charaters long", word, strlen(word));
}

fclose(wordFile);
return 0;
}

IOS

Posted by arkgame