Big thanks to all of you!
I finally solved my problem by changing the way data is written to the file:
I made sure it always had three digits and then used fseek() to point to SEEK_END - 3. fscanf...
Type: Posts; User: GCWilkins
Big thanks to all of you!
I finally solved my problem by changing the way data is written to the file:
I made sure it always had three digits and then used fseek() to point to SEEK_END - 3. fscanf...
From your quote:
I have tried changing everything to "Total sencillos = %d" and also to "Total sencillos=%d", with no luck
Seriously, I'm gonna end up in a madhouse!
This is my function:
int get_data(FILE *pf){
int data=0;
char line[CHAR];
char last_line[CHAR];
char empty_line[CHAR]="\n";
...
Thank you both, I now understand how the function works, but I'm still fighting with the isBlank() condition:
Then,
if(line!="\n") should do the trick, right?
I've tried it but I don't get the...
I'm sorry but, being a novice, i don't quite understand your code there.
I assume it looks for the last written line, copies it to another string and then uses sscanf to identify the integer
Evenif...
Hi, I'm learning to use files in C and I was wondering how to access an integer at the end of a text file.
The file has some strings before, and the last line should be:
Output=6
I'd like to...