Return value of printf() and scanf() functions.

int len = printf("ndjlfi");     //len = 6;
len = printf("a = %d, b = %d",a,b);   //len = 12

The return value of printf is the length of the string in "".

int len2 = scanf("%d %d",&a,&b); //After correct assignment of a,b, len2 = 2;
The return value of scanf() is the number of correct input data;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324948003&siteId=291194637