What is Pointer to constant?

Submitted by: Administrator
Pointer to constant points to a value that does not change and is declared as:

const type * name
type is data type
name is name of the pointer
e.g: const char *p;

pointer to constant can not be used to change the value being pointed to. Therefore:
char ch = ‘A';
const char *p = &ch;
*p = ‘B';

is not allowed. The program will throw an error.
Submitted by: Administrator

Read Online C++ Pointers & Functions Job Interview Questions And Answers