我建立了一个 console 支持 MFC的应用
在主文件里
#include "string.h"struct sms{
string tel_num;
string msg;
};
就能BUILD但在新加的类的头文件里 就有错
error C2146: syntax error : missing ';' before identifier 'tel_num'在string上右键 goto定义 有时找到在XSTRING里 有时在XLOCNUM里由于这个string,后面调用sms tel_num msg 的地方产生了上百个错误,烦死我啦!
到处加
#include "string.h"
#include <string>
都没用
在主文件里
#include "string.h"struct sms{
string tel_num;
string msg;
};
就能BUILD但在新加的类的头文件里 就有错
error C2146: syntax error : missing ';' before identifier 'tel_num'在string上右键 goto定义 有时找到在XSTRING里 有时在XLOCNUM里由于这个string,后面调用sms tel_num msg 的地方产生了上百个错误,烦死我啦!
到处加
#include "string.h"
#include <string>
都没用
CString tel_num;
CString msg;
};
CString可以吗?如果用char*的话 怕不安全,tel_num[i]可能会超出范围
或者,怎么给 char*分配连续的200byte 空间?
using namespace std