Q:

What is the meaning of the below declarations?

0

What is the meaning of the below declarations?

1. const int a;
2. int const a;
3. const int *a;
4. int * const a;
5. int const * a const;

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

  1. The “a” is a constant integer.
  2. Similar to first, “a” is a constant integer.
  3. Here “a” is a pointer to a const integer, the value of the integer is not modifiable, but the pointer is modifiable.
  4. Here “a” is a const pointer to an integer, the value of the pointed integer is modifiable, but the pointer is not modifiable.
  5. Here “a” is a const pointer to a const integer that means the value of the pointed integer and pointer both are not modifiable.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is the output of the below C program?... >>
<< When should we use const in a C program?...