Hey,
Simple answer i'm sure, but can't seem to find a clear answer...
How do you write a text file to a character array in C?
mjh
Hey,
Simple answer i'm sure, but can't seem to find a clear answer...
How do you write a text file to a character array in C?
mjh
By simply reading its content into a char array using fgets(), just as explained here (urgh, that link is actually pretty bad), better explained here.
You might also want to read the C string tutorial where an example with fgets() is given.
Last edited by KONI; 04-02-2007 at 07:59 AM.
or strcpy and other function fro manipulating strings like sprintf
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler