Hello i'm a new programmer in C (my first language). I've got a problem while reading a file. I'd like to know the lenght of a file line in order to use fseek later, but i can't find a way to do this. Using fscanf(f, %c, &p) printf("%d", p) I get the ascii code of the character read, but it's a crazy number, sometimes prints 0, sometimes 104, usually the code of the last "good" character read... I know that '\n'=10, and blank space=32, so i've tried also something like if(p='\n') system("pause")... but notthing happens so p don't have to be '\n'. Well, i'd also like to know, is possible, the ascii code for EOF. I know it's -1, but when we ask while(fscanf(.....)!=EOF)), how does fscanf know that has reached the end of file and return -1?
Thanks in advance.