بازگرداندن یک ارجاع به یک عضو داده ی خصوصی چیه؟
int& time::badsethour(int hh)
{
hour=(hh>=0 && hh<24) ? hh : 0;
return hour;
}
.
.
.
.
int main(){
time t;
int& hourRef = t.badsethour (20);
cout<<"hour before modification: "<<hourRef;
hourRef=30;
cout<<"hour after modification: "<<t.getHour //chera hour = 30 mishe?