首页 > 代码库 > 函数scanf的返回值

函数scanf的返回值

代码:

#include <stdio.h>
#include <stdlib.h>

int main(void) {

	int i;
	double d;
	char ch;

	int counter;
	counter = scanf("%i %lf %c", &i, &d, &ch);
	printf("The return value of function is %d.\n", counter);

	return EXIT_SUCCESS;
}


输入:

1 2.0 3


输出:

The return value of function is 3.


函数scanf的返回值