比如有
CString strValue1;
CString strValue2;CString strValue;strValue = strValue1 + strValue2;这样不行吗?我看说明是这样写的,可是strValue为空啊(strValue1 = "10" strValue2 = "20")
我要得到1020
CString strValue1;
CString strValue2;CString strValue;strValue = strValue1 + strValue2;这样不行吗?我看说明是这样写的,可是strValue为空啊(strValue1 = "10" strValue2 = "20")
我要得到1020
在strValue = strValue1 + strValue2;这句代码里strValue1和strValue2都有值,但是运行完这一句,strValue还是为空
CString strValue = _T("");
赋初值试试看
CString strA = L"10";
CString strB = L"20";
CString strC;
strC = strA + strB;
MessageBox(strC);
没有任何问题
结果运行完那一句 strValue = strValue1 + strValue2;
strValue的值就变空了,把之前赋值的初值"a" 也没了
strValue = strValue + strValue1 + strValue2;
这样呢?
而且都取出来了,在界面上也显示出来了
就是连接的时候始终不对。搞不清楚了我是在VS2008下建的MFC工程,不知道跟环境有没有关系的??
CString X2Value = "0.25";
double dblValue = atof(X2Value);
下面double转化后,dblValue的值变成0.2500000000001这个结果对吗?其实我计算时只要0.25就行了当然,这个转化由于值很小并不影响我计算结果
CString strValue1="10";
CString strValue2="20";
CString strValue="0";
strValue = strValue1+strValue2;
MessageBox(strValue,NULL,MB_OK);结果对啊 ,你是不是strValue1和strValue2的值有问题
不行就用Format试试。
CString strValue1;
CString strValue2;CString strValue;strValue.Format(_T("%s%s"),strValue1,strValue2);;
2003系统+ VS2008 + MFC基于对话框工程