Read a txt file in C
hi,
I start to hate C, because I don't understand what's going on inside the primitives functions. Why this example, doesn't read a txt fil.e The temp.txt exists and it's in the same path has the C file. Code:
The C is killing me, because I don't understand what's going on. |
I'd start off by taking the file reading procedure into it's own .C file (minimal main() to test it), compile it and see if it works or not. When it works, then just move the code into your bigger program..
Also if it's in the same directory, you don't need "./filename.txt", "filename.txt" should do just fine. EDIT: something like Code:
#include <stdio.h> |
Code:
while(fgets(data, 80, fd) != NULL) |
Thank you for the help.
|
All times are GMT -5. The time now is 10:50 PM. |