下面的代码为什么不能编译呢,出现这个错误呢
.\clr.cpp(12) : error C3149: “System::String”: 此处没有顶级“^”,不能使用此类型
请高手指教一下,谢谢
// clr.cpp: 主项目文件。
#include "stdafx.h"
#include "stdio.h"
#include "windows.h"
using namespace System;
public ref class CustomEventAgs:public EventArgs
{
public:
CustomEventAgs(System::String^ str);
private:
String msg;
};
int main(array<System::String ^> ^args)
{
char input,o;
Console::WriteLine(L"Hello World");
return 0;
}
CustomEventAgs::CustomEventAgs(System::String^ str)
{
throw(gcnew System::NotImplementedException);
}
------解决方案--------------------------------------------------------
试试 Console::WriteLine(gcnew System::String^("Hello World"));
------解决方案--------------------------------------------------------
String^ msg;