Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File pointers and streams in C
#1
File pointers are used to interact with files.

FILE *file = fopen("data.txt", "r");
if (file != NULL) {
    int ch;
    while ((ch = fgetc(file)) != EOF) {
        putchar(ch); // Output: Contents of the file
    }
    fclose(file);
}
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Uninitialized pointers in C Qomplainerz 0 221 07-26-2023, 07:10 AM
Last Post: Qomplainerz
  Passing pointers to functions in C Qomplainerz 0 278 07-25-2023, 11:42 AM
Last Post: Qomplainerz
  Understanding pointers and memory addresses in C Qomplainerz 0 248 07-25-2023, 11:41 AM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 7 Guest(s)