include
include
include
/******************************************************************************************************/
define crr(a0,a1,a2,a3) “insert into table(col1,col2) values (‘”+a0+”’,’”+a1+”’,’”+a2+”’,’”+a3+”’)”
define crr1 “insert into table(col1,col2) values (‘%s’,’%s’,’%s’,’%s’)”
/******************************************************************************************************/
using namespace std;
int main_template(){
char buffer[100];
char buffer1[100];
string s1=”a”;
string s2=”b”;
string s3 = “c”;
string s4 = “d”;
sprintf(buffer, crr1, s1.c_str(), s2.c_str(),s3.c_str(),s4.c_str());
string sql = crr(s1, s2,s3,s4);
string sql1 = crr1;
system(“pause”);
return 0;
}这里写代码片