close

 

C++ Language :

 

  a. ) ISO C++

  b. ) C++/CLI ( Common Language Infrastructure ) - .NET Framework

 

。Managed ( gcnew )  only C++/CLI

。Unmanaged ( new )

 

Unmanaged :

 
#include "stdafx.h"

using namespace System;

class CPoint {
public:
        int x;
        int y;
        CPoint() {;}
        CPoint(int x, int y) {
                this->x = x;
                this->y = y;
        }
        ~CPoint() {;}
};

int main(array<System::String ^> ^args)
{
	CPoint* p = new CPoint( 3 , 5 );
	return 0;
}
 

 

 Managed :

 
#include "stdafx.h"

using namespace System;

ref class CPoint {
public:
        int x;
        int y;
        CPoint() {;}
        CPoint(int x, int y) {
                this->x = x;
                this->y = y;
        }
        ~CPoint() {;}
};

int main(array<System::String ^> ^args)
{
	CPoint^ p = gcnew CPoint( 3 , 5 );
	return 0;
}
 

 

arrow
arrow
    創作者介紹
    創作者 Cuby 56 的頭像
    Cuby 56

    Cuby56

    Cuby 56 發表在 痞客邦 留言(0) 人氣()