开发者

_bstr_t concatenate gives 12142

开发者 https://www.devze.com 2023-03-01 14:56 出处:网络
I have a strange thing here. I\'m concatenati开发者_如何学Gong _bstr_t strings in order to assemble a SQL command.

I have a strange thing here. I'm concatenati开发者_如何学Gong _bstr_t strings in order to assemble a SQL command.

_bstr_t strSQL = a+b+k+hk+Allin+hk+k+hk  

...and so on.

When I print it to the console (using std::wcout << '/n'<< strSQL << '/n';) I get my string, BUT with a 12142 in the beginning and end of the string. It looks like:

 12142"SELECT * FROM....."12142

Does anyone know where it comes from?

I'm using: VS2010 Express, C++, and I'm building a console app.


You wrote '/n' instead of '\n'. This is a multicharacter literal, which in this case gives an integer with the value 12142.

0

精彩评论

暂无评论...
验证码 换一张
取 消