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
This is a discussion on Write text file to char array within the C Programming forums, part of the General Programming Boards category; Hey, Simple answer i'm sure, but can't seem to find a clear answer... How do you write a text file ...
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
If I have eight hours for cutting wood, I spend six sharpening my axe.