+ 1

when I use *ip to initialize the pointer variable,

int x; int *ip; *ip = &x; Visual Studio gives an error: Error C2440 '=': cannot convert from 'int *' to 'int' Can someone please explain to me why i get this error?

19th May 2020, 11:36 PM
Iragaba Ramathan
Iragaba Ramathan - avatar
2 Respuestas
+ 4
Use ip = &x *ip dereferences and is used to access the value stored at the address held by the pointer ip.
20th May 2020, 12:06 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
20th May 2020, 2:53 PM
Iragaba Ramathan
Iragaba Ramathan - avatar