C
Chad
I have the folllowing
#include <stdio.h>
int main(void)
{
int x = 1, y = 2;
int *ip;
ip = &x;
y = *ip;
printf("The value is: %d\n", y);
return 0;
}
Would *ip in y = *ip be a lvalue or rvalue in this case? Here is my
main source of confusion. I thought that applying the indirection
operator to ip would yield a lvalue and thus something like *ip could
only appear on the left hand side. However,since *ip is on the right
hand side in this case, would *ip be a lvalue or rvalue?
Chad
#include <stdio.h>
int main(void)
{
int x = 1, y = 2;
int *ip;
ip = &x;
y = *ip;
printf("The value is: %d\n", y);
return 0;
}
Would *ip in y = *ip be a lvalue or rvalue in this case? Here is my
main source of confusion. I thought that applying the indirection
operator to ip would yield a lvalue and thus something like *ip could
only appear on the left hand side. However,since *ip is on the right
hand side in this case, would *ip be a lvalue or rvalue?
Chad