#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
printf("Hello " "World!/n");
char szSQL[1024];
int iStuID = 10,
iClassID = 100;
sprintf(szSQL,
"Select * from Score where "
"StuID = %d"
"and ClassID = %d/n",
iStuID,
iClassID
);
printf(szSQL);
return 0;
}
程序运行结果如下:
Hello World!
Select * from Score where StuID = 10and ClassID = 100
从第二行输出结果,你看出什么来了么?