i have studied this following statement from a book "Each scanning function returns EOF if it encounters end-of-file before any conversion; otherwise it returns the number of successful conversions that were stored."
To test this i have written the following code
i have given directly EOF character Ctrl + Z followed by return key as input. The output is ret = 1 instead of -1. where am i doing the mistake? i know i am doing a mistake some where.
int main(int argc, char *argv)
ret = scanf("%c",&c);
thanks in advance,