专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > VC

刚学习vc.net 请问一个String做参数的有关问题,请高手指教一下

发布时间:2011-06-23 14:27:32 文章来源:www.iduyao.cn 采编人员:星星草
刚学习vc.net 请教一个String做参数的问题,请高手指教一下
下面的代码为什么不能编译呢,出现这个错误呢
.\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;
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: