implementing property in c++ just like c#?
hello all .
i was recently coding a test application in Visual C++.net and i faced sth that , to me was strange .
we all know that in c# we can access properties very easily sth like :
but in c++ we have sth like these:
btn.Text = "Setting the text ";
string variable = btn.Text;
there is always a Set() function to set the values, and Get() function to retrive the values.!
string var = btn->GetText();
having all said , i saw the c# conventional use of property in c++, i mean i could write !:
!and i wondered if it is really possible to have sth like this in c++ .
btn->Text = "sth goes here!";
string variable = btn->Text;
thats all , so is it all MS VC++.net specific ? or no this can be achieved in general c++ too ?
i will be very thankful if anyone gives me an answer
and isn't there anyway to implement such thing in c++? ( i mean writing properties just like what we have in c# ?)
Thank you in advance
Cout is printing numbers from right to left
Damn I can't believe I did that!
Sorry, I was going to start a new thread, and then posted here.