CString类型和double型怎样转换?
CString类型和double型怎样转换?要加什么头文件?
如果在mfc里面用CString类型和double型转换,要怎样写?
[此贴子已经被作者于2007-9-26 17:42:00编辑过]
#include "stdio.h"
#include "afx.h"
#include "iostream.h"
#include "stdlib.h"
void main()
{
CString s="3.5";
double d1 = atof(s);
double d2 = 4.11;
CString temp;
temp.Format("%f", d2);
printf("%f\n",d1);
printf("%s",temp);
}
在VC6,编译构建后出现下面的错误:
----------Configuration: cstringlianxi - Win32 Debug--------------------
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/cstringlianxi.exe : fatal error LNK1120: 2 unresolved externals
执行 link.exe 时出错.
cstringlianxi.exe - 1 error(s), 0 warning(s)
不知道为何