<分区>
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[]) {
FILE* file = fopen("questions-words.txt", "r");
char line[256];
while (fgets(line, sizeof(line), file) != NULL) {
if (line[0]==":") {
continue;
}
printf("%s", line);
}
fclose(file);
return 0;
}
您好,我尝试打印文件的行并跳转以“:”开头的行,但它似乎不起作用。 我也无法打印 line[0] 它会发出警告,因为“line is type int”