Computer Science, asked by modimanan51, 5 months ago

Question 5- When we declare constant pointer to integer, we
CANNOT change:
1. Value pointed by pointer
2. Either addressing pointer variable or value at that
address
3. Changes are not permitted
4. Address in pointer variable​

Answers

Answered by vijayalakshmi35
4

Answer:

3. Changes are not permitted

Explanation:

Bcoz pointer is given as constant pointer to the integer when are giving a constant it cannot be modified so changes are not modified or permitted.

Answered by ankhidassarma9
0

Answer:

When we declare constant pointer to integer, we

CANNOT change the  Address in pointer variable​

Explanation:

int *const is a constant pointer to integer .

  • Constant pointer to integer  means that the variable being declared is a constant pointer pointing to an integer.
  • This implies that the pointer shouldn’t point to some other address.
  • Const qualifier doesn’t affect the value of integer in statement. So the value being stored in the address which is containing by the pointer, is allowed to change.
  • int a=10,b=20;

      int *const t = &a; \\ where 'a' is a integer variable.

       *t = 20    \\ will work

         t = &b   \\ will not work

Similar questions