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 :
Code:
btn.Text = "Setting the text ";
string variable = btn.Text;
but in c++ we have sth like these:
Code:
btn->SetText("sth");
string var = btn->GetText();
there is always a Set() function to set the values, and Get() function to retrive the values.!
having all said , i saw the c# conventional use of property in c++, i mean i could write !:
Code:
btn->Text = "sth goes here!";
string variable = btn->Text;
!and i wondered if it is really possible to have sth like this in c++ .
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