There are three type of string pointer.

const char * - This is a mutable pointer which points to a constant string.

Example:

const char * str = "Hello World";
str++;//OK
str[0] = ' ';//Not compilable

char * const - This is a const pointer pointing to a writable string.

Example:

char * const str = "Hello World";
str++;//Not Compilable
str[0] = ' ';//OK

const char * const - This is a const pointer pointing to a read-only string.

Example:

const char * const str = "Hello World";
str++;//Not Compilable
str[0] = ' ';//Not Compilable

About our authors: Team EQA

You have viewed 1 page out of 252. Your C learning is 0.00% complete. Login to check your learning progress.

#