Sample C Programs
-
filereader.c
-- Reads integers from a file, fscanf()
-
filereader2.c
-- Reads strings (separated by whitespace) from a file, fscanf()
-
filereader3.c
-- Reads lines of strings from a file, fgets()
-
filereader4.c
-- Reads characters from a file, fgetc()
-
filereader5.c
-- Reads characters from a file, fgetc(), also puts a character back into
the file, ungetc()
-
filereader6.c
-- Reads integers from a file and stores them in an array
-- This array is statically allocated - int num[1000];
-
filereader7.c
-- Reads integers from a file and stores them in an array
-- This array is dynamically allocated - int *num and use malloc() for
memory allocation