請好好咁講解一下 L-Value 同 r-Value in C programming language
咩係L-Value
咩係r-Value
請卑例子
用英語答最好
2006-10-15 23:40:08 · 1 個解答 · 發問者 auyeung_ks 3 in 電腦與網際網路 ➔ 程式設計
In general, l-value is an expression that you can put on the left side of the assignment operator (=). All l-values have an assigned memory that is addressable by the user. These include pointers, variables of all types, structures, etc.
For example,
double a,b,c;
char *d;
char list[23];
a,b,c,d and list are all l-values.
Right values are expressions that do not occupy a memory space, and hence cannot be put on the left of the assignment operator.
Examples are: i++, a+b, *d etc.
Hope this answers your question.
2006-10-16 05:18:36 · answer #1 · answered by p 6 · 0⤊ 0⤋