Рет қаралды 49,224
C read a file tutorial example explained
#C #read #file
int main()
{
FILE *pF = fopen("poem.txt", "r");
char buffer[255];
if(pF == NULL)
{
printf("Unable to open file!
");
}
else
{
while(fgets(buffer, 255, pF) != NULL)
{
printf("%s", buffer);
}
}
fclose(pF);
return 0;
}