Is the expression that allocates memory rvalue expression or lvalue expression?

ساخت وبلاگ

Vote count: 0

Let say I have the following code

int main(){ new int; // Is this expression l-value or r-value?? retu 0;
}

I know that lvalues are persistent object (since it has specific place in memory from where we can access latter even after the expression ends) and rvalues are temporary object (it has no place in memory and vaporizes after the expression ends).

I saw some where that it is rvalue expression. How can it be rvalue if we the expression retus an address ( a specific place in memory). Or Is it rvalue because what ever the expression new int retus (an address value), it vanishes and could never be caught.

asked 54 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 272 تاريخ : دوشنبه 18 مرداد 1395 ساعت: 12:10