★参考资料★ http://www.ok2002.com/cc/cc/v.asp?r=a1999113118813
#include<iostream.h>//C++字符转换转化int,C++ atoi()源程序
#include<stdlib.h>
#define MAX 50
void main()
{
char str[MAX];
cout<<"请输入一个字符串:";
cin>>str;
int n=atoi(str);//字符串转换为int
cout<<"n="<<n<<endl;
}
CFile file;
CString str;
GetDlgItemText(IDC_EDIT1,str);//IDC_EDIT1是编辑框的ID啊不一样就改下
file.Write(str,str.GetLength());
file.Close();
API;
SendMessage(hwnd,WM_GETTEXT,255,str)
hwad是edit的句柄 str 要保存字符串的变量
一、int/long/float/double转字符串
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载