#include <iostream>
#include <string>
#include <vector>
using std::string;
using std::vector;
using std::endl;
using std::cout;
namespace AAH
{
class messageTemplate;
};
using namespace AAH;
int main()
{
messageTemplate templateMSG32("hello world");
cout << templateMSG32.version << endl;
return EXIT_SUCCESS;
}
namespace AAH {
class messageTemplate
{
public:
messageTemplate() : version("XX.XX.XX.001") {}
messageTemplate(string ver) : version(ver) {}
string version;
};
};
好的,这是代码,
我收到一条错误消息:
Error 3 error C2228: left of '.version' must have class/struct/union
我在用visual studio 2012
谁能告诉我为什么我会收到这个错误