首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VC >

怎么支持C++.net的混合类型

2012-03-27 
如何支持C++.net的混合类型#includeiostream#includestringusing namespace Systemusing namespace s

如何支持C++.net的混合类型
#include<iostream>
#include<string>
using namespace System;
using namespace std;

namespace Namespacedll 
{

public ref class Student
{
private:
int id;
int age;
string name; public:
  Student();
Student(int _id,int _age);
};

错误1error C4368: 不能将“name”定义为托管“Namespacedll::Student”的成员: 不支持混合类型c:\users\zhang\desktop\clr制作dll\namespacedll\namespacedll\Student.h17


}

[解决办法]
http://msdn.microsoft.com/zh-cn/library/xhfb39es%28v=VS.90%29.aspx

string name;
改为
String^ name;

热点排行