Visual C++ 2005与Visual C#的对比(委托的使用)
Visual C++ 2005:
interface class IShape
{
void Draw();
}
ref class Circle:IShape
{
Point center;
int radius;
void draw();
};
Circle^ c = gcnew Circle();
delegate void MyDelegate();
MyDelegate^ d = gcnew MyDelegate(c , &Circle::Draw)
Visual C#:
Interface IShape
{
void Draw();
}
class Circle:IShape
{
Point center;
int radius;
void draw();
};
Circle* c = new Circle();
delegate void MyDelegate();
MyDelegate d = new MyDelegate(c->Draw)
我思故我在