Quantcast
Viewing all articles
Browse latest Browse all 7

Ref Class Question

Hmm... no problem... but what are you trying to do in fact ?

ref class C1

{

public:

ref class NC1

{

public:

static int s1;

int m1;

String ^m2;

};

NC1 ^mnc1;

static int s2;

};

With this you can write the following:

C1 ^c = gcnew C1; // create an instance of the C1 class

c->mnc1 = gcnew C1::NC1; // create an instance of the C1::NC1 class

c->mnc1->m2 = "2"; //access of the m1 instance field of the C1::NC1 class

C1::NC1::s1 = 2; // access of the s1 static field of the C1::NC1 class

C1::s2 = 3; // access of the s2 static field of the C1 class

 


Viewing all articles
Browse latest Browse all 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>