问题描述
- 学习objective-c 基础教程遇到问题 例题03.06 word-length-3 编译出错
-
#importint main(int argc, const char * argv[])
{
FILE *wordFile = fopen ("/tmp/words.txt", "r");
char word[100];while (fgets(*word,99,wordFile)) \这一行编译出现“Thread 1:EXC_BAD_ACCESS(code=1.address=0xffffff……)“ { word[strlen(word) - 1] = ''; NSLog (@"%s is %lu characters long", word, strlen(word)); } fclose (wordFile); return 0;
}
时间: 2025-01-01 09:00:57