Dear Friends ,
plz tell me that what is the return type of printf() and scanff in C
means what they return ?
sanjay
scanf returns as an int function result the number of successful conversions or EOF on input failure
you can use this see if the scanf() worked, e.g.
-
int a;
-
float b;
-
if((scanf("%d%f", &a, &b)) != 2)
-
printf("input failed\n");
-
if the scanf() result is not 2 the read of a and b failed
in the case of print the int function result is
On success, the total number of characters written is returned.
On failure a negative number is returned.