79130438

Date: 2024-10-27 11:14:55
Score: 1.5
Natty:
Report link

Actually, 'a' is not just any variable but a pointer variable which stores the address of an integer type variable 'b'. So, when you print 'a', then according to the data given, it will represent the content of pointer variable 'a' = 0x867f, but &a is used to represent the location or address of the pointer variable 'a'. So, &a = 0x77e4. But if you write *a after declaring the pointer variable and storing the address of another variable (here 'b'), then now this * is called a dereferencing operator whose function is to provide the content of the content of variable 'a', (i.e) to give the content of the location '0x867f' which is stored in 'a'. Now, *a = 100, which is the value of the variable 'b'. So, the values of a, &a and *a all are different from one another.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Ahana Manna