Wipro
Company
Programming
Program
What's the difference between const char *p, char * const p and const char * const p?
Read Solution (Total 3)
-
- const char *P and char * const p
in 1st case it is a pointer to a constant char and
in second case it is a constant pointer to the non-constant char i.e:- char can be changed but not the pointer pointing to it.
In third case const char * const p it is a constant pointer to the constant char. - 10 years agoHelpfull: Yes(26) No(0)
- 1 const char *p=value is constant it cannot be modified
2.char * const p=address is constant so it cannot be modified
3.const char * const p=both value & address is constant so both value and address cannot be modified - 8 years agoHelpfull: Yes(4) No(0)
- char *p is type of variable
char*cont p will store values of p which are constant
contant char * is atype of symbo, defined for constant characters - 10 years agoHelpfull: Yes(1) No(0)
Wipro Other Question