(10分)講解一下L-Value 同 r-Value

2006-10-16 11:40 am
請好好咁講解一下 L-Value 同 r-Value in C programming language
咩係L-Value
咩係r-Value
請卑例子

用英語答最好

回答 (1)

2006-10-16 5:18 pm
✔ 最佳答案
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.


收錄日期: 2021-04-12 20:07:09
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20061016000051KK00519

檢視 Wayback Machine 備份