佚名通过本文主要向大家介绍了ccombstr,ccombstr cstring,格式化字符串,c#格式化字符串,python 格式化字符串等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 怎样格式化一个CComBSTR字符串?
描述:
解决方案1:
描述:
我定义了一个CComBSTR字符串如下:
CComBSTR str1(select count(*) from A08_TOLLFARE where ExitPlzID='' and Version='');
如何格式化它,CString有Format,这个怎么格式化成一个完整的SQL语句?
解决方案1:
char buf[1024];
memset(buf,0,1024);
sprintf(buf,"select count(*) from A08_TOLLFARE where ExitPlzID='%d' and Version='%d',ExitPlzID,Version);
CComBSTR str1(buf);
当然也可以用wsprintf之类的