1.cout,在输出的时候先把要输出的存入缓冲区。如果不换行(endl),就不会把写向标准输出的内容输出到屏幕上,而是保存在缓冲区里。所以有时候输出慢了点:-)
2.print函数,可以返回一个值,只能有一个参数。用起来最简单
3.printf函数,把文字格式化以后输出,直接调用系统调用进行IO的,他是非缓冲的。如:
name="hunte";
age=25;
printf("my name is %s, age %d", &name, &age);
4.sprintf--跟printf相似,但不打印,而是返回格式化后的文字,其他的与printf一样。如:char sql[256];sprintf(sql,"select * from table where no = '%s'",bankno);它的功能只是把""里面的语句赋给了变量sql。
*********************************************************************
为什么:
#include "stdio.h"
#include "iostream.h"
void main()
{
cout