while(feof(fp) != true)
{
}
という風にループにできる
main.cpp
#include <stdio.h>
int main()
{
FILE *fp;
char buf1[256];
fp = fopen("aa1.x", "r");
if (fp == NULL) {printf("can't open the file");};
while(feof(fp) != true)
{
fgets(buf1, 256, fp);
printf(buf1);
};
fclose(fp);
};
コメントをかく