// printfRet.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int main(int argc, char* argv[])
{
int ret=0;
int a=104;
ret=printf("%d",a);//printf将返回3,
printf("\n%d\n",ret);
ret=printf("123\n");//printf将返回4
printf("\n%d\n",ret);
//printf("Hello World!\n");
return 0;
}
/*
104
3
123
4
Press any key to continue
*/
printf的返回值为int类型,即为当前打印字符的个数
最新推荐文章于 2024-03-11 20:53:56 发布