0
点赞
收藏
分享

微信扫一扫

printf的返回值为int类型,即为当前打印字符的个数

后来的六六 2023-06-16 阅读 66


// 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
*/



举报

相关推荐

0 条评论