← Learn to Code
Learn to Code04:33
C reading files 🔎
From the creator
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!\n");
}
else
{
while(fgets(buffer, 255, pF) != NULL)
{
printf("%s", buffer);
}
}
fclose(pF);
return 0;
}
Published 2021-10-06 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.
Keep exploring Learn to Code
07:31Learn to Codesentdex
06:03Learn to Codesentdex
06:36Learn to Codesentdex
10:56Learn to Codesentdex
07:10Learn to Codesentdex
12:27Learn to Codesentdex
06:03Learn to Codesentdex