You cannot assign an address xbecause the address is xnot an lvalue
(Of An lvalue- is "something that can be assigned", ie it can not be of L eft side of the equals sign)
Try
int* x;
x = (int*) malloc(3*sizeof(int));
Now xpoints to the allocated memory, and you can do something like
int foo = *x;
int bar = x[0];
You can assign an address to xanother using the operator &as follows:
int x = 1;
int* y = &x;
*y = 2;
source
share