为什么“cerr<< s;“输出不同的字符串为s,而控制台的输出添加”1 * 1 * 0 * 1 * 1 * 1 * 1 * 0 * 0 * 1 * 0 * 1 * 1 * 1 * 1 * 0 *“向导字符?

时间:2013-03-14 11:18:31

标签: c++ string io console

我调试了该程序并看到s == "101111000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000101111000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
但在控制台中,它输出"1*1*0*1*1*1*1*0*0*1*0*1*1*1*1*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*101111000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000101111000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
它只添加了"1*1*0*1*1*1*1*0*0*1*0*1*1*1*1*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*"的向导字符 产生输出的代码:

UINT8 sMessage[4096];
memset(sMessage, 0, 4096);

Num_Thread = 0;
OutputNum_Thread = 0;

EncodeInitiatedTestCommandActionSet(&InitiatedTestCommandACTION, sMessage);//fill sMessage with "0101...0101..."

string s = (char*)sMessage;

cerr << s << "\n";

(使用QT)

0 个答案:

没有答案