i have a code like this:
I only entered '1' , then I hit enter, this value should be read in. I hit enter the second time, the scanf() should return a false and jump out of the function. But it did not work in that way, it only jumps out until I entered a letter. could anyone tell me the reason? thanks.Code:int store(double a[],int limit) { int i=0; while(i<limit&&scanf("%lf",&a[i])==1) i++; return i; }