Imagine I have a csv with and each value is an integer. so the first value is the INTEGER 100
.
I want fscanf() to read this line, and either tell me it's an integer ONLY, or not. So, it would pass 100
but fail on 100t
. What i've been trying to get work is "%d," where the comma is the delimiter of my CSV. so the whole function is
fscanf(fp, "%d,", &count)
Unfortunately, this fails to fail on '100t,' works on '100' and works on 't'. so it just isn't distinguishing between 100
and 100t
(all of these numbers are followed by commas, of course