VC.net初学者遇到的一个奇怪问题.死活看不出来有什么错误!!!!! 大家帮帮忙
死活看不出来有什么错误!!!!! 大家帮帮忙
正在编译...
Pointtest.cpp
f:\我的文档\visual studio projects\pointtest\Point.h(43) : error C3149: “Point” : 非法使用托管类型“Point”;是否忘记了“*”?
f:\我的文档\visual studio projects\pointtest\Point.h(43) : error C2533: “Point::__ctor” : 构造函数不能有返回类型
f:\我的文档\visual studio projects\pointtest\Point.h(43) : fatal error C1903: 无法从以前的错误中恢复;正在停止编译
#pragma once
#using <mscorlib.dll>
using namespace System;
public __gc class Point
{
public:
Point();
Point(int,int);
__property int get_X()
{
return x;
}
__property void set_X (int value)
{
x=value;
}
__property int get_Y()
{
return y;
}
__property void set_Y(int value)
{
y=value;
}
String *ToString();
private:
int x;
int y;
}
Point::Point()
{
}
Point::Point(int xValue,int yValue)
{
x=xValue;
y=yValue;
}
String *Point::ToString()
{
return String::Concat(S"[",x.ToString(),S","y.ToString(),S"]");
}