In my app, my program has to read a set of data (each per line) in the txt file. I used the following statement in order to do this, i.e. while (fscanf_s(fp_t, "%ld\n", &number)), where the type of "number" is unsigned int.
While, if there is a number, e.g.9512312222222222222222222, in the txt file, no matter which format I specified in fscanf_s (%u or %ld), the data read from the file is 4087407502.
However, if my program, such "9512312222222222222222222" in the file which actually exceeds the upper limit of "unsigned int" should be reported as "an error". How can I implement it?
Can you give me a hand with it?
Thanks in advance,