operator of "*" must be a pointer

Why do I get operator of * must be a pointer error when I write this code?

1
2
  uint32_t a = 0x40023830;
  *a= 0x9;
Because dereference operation can be applied only to pointer.
a is not a pointer so you cant do *a =.

to put it simple *a means set data of "a" when "a" is a pointer

in your case "a" is not a pointer so is should be

1
2
uint32_t a = 0x40023830;
 a= 0x9;


or if "a" needs to be a pointer then this should work

1
2
int* a = new int(0x40023830);
*a = 0x9;
Topic archived. No new replies allowed.