Hi!
I have a very strange problem! When I save long integer to textfile, everything works well, but when I try to read it, I get completely different value.
What is wrong? Thank you!Code:#include <stdlib.h> #include <stdio.h> int main(){ long long_int; FILE *fd = fopen("file", "w"); fprintf(fd, "%li\n", 245749955); fclose(fd); FILE *fd2 = fopen("file", "r"); fscanf(fd2, "%li\n", long_int); printf("%li\n", long_int); // OUTPUT IS -1073744252, BUT IT SHOULD BE 245749955 fclose(fd2); return 0; }