Heres the code:
The first line of 'stats.dat' has a name, I want that name in 'char name', how do I do that?Code:FILE * fileP; main() { fileP = fopen("C:\\textad\\stats.dat", "r+") ... fseek(fileP, 0, SEEK_SET); char name[36] = ???;
Heres the code:
The first line of 'stats.dat' has a name, I want that name in 'char name', how do I do that?Code:FILE * fileP; main() { fileP = fopen("C:\\textad\\stats.dat", "r+") ... fseek(fileP, 0, SEEK_SET); char name[36] = ???;
THERE IS NO PLACE LIKE 127.0.0.1
Though it looks like you're compiling as C++ since C doesn't support variable declarations except at the top of a block of code.Code:fgets(name, sizeof (name), fileP);
p.s. What the alphabet would look like without q and r.
I got this error:
Line 7, *:\***l\Dev-Cpp\***\main.c, invalid initializer :\
THERE IS NO PLACE LIKE 127.0.0.1
Then you are compiling as C, it's not legal code so you're sure to get a diagnostic when you try and compile. Try this instead:
Code:FILE * fileP; main() { char name[36]; fileP = fopen("C:\\textad\\stats.dat", "r+") ... fseek(fileP, 0, SEEK_SET); fgets(name, sizeof (name), fileP);
p.s. What the alphabet would look like without q and r.