C++
Programming and Technical
Programming
Technical
Which one of the following is the correct option showing the declaration(s) of a pointer to constant integer?
[1] const int* a;
[2] int* const a;
[3] int const* a;
[4] 1 and 3 both
[5] 1 and 2 both
[6] 2 and 3 both
[7] None of the above
Read Solution (Total 8)
-
- ans is: cont int * a y bcz here pointer is pointing to const int
- 8 years agoHelpfull: Yes(3) No(0)
- option 4 is correct.
1 and 3 both are right declaration - 8 years agoHelpfull: Yes(3) No(0)
- 3) int const* a;
- 8 years agoHelpfull: Yes(1) No(0)
- const int* a:
- 8 years agoHelpfull: Yes(0) No(1)
- 1 and 2 both
- 8 years agoHelpfull: Yes(0) No(1)
- 2 and 3
we have to show pointer as an constant integer
- 8 years agoHelpfull: Yes(0) No(0)
- 1 and 3 both
- 8 years agoHelpfull: Yes(0) No(0)
- only 2 is right.
int * const a;
that means a is a const variable which is integer pointer type. - 7 years agoHelpfull: Yes(0) No(0)
C++ Other Question