• Tutorials
  • DSA
  • Data Science
  • Web Tech
  • Courses
July 07, 2022 |6.5K Views

Difference between const char *p, char * const p and const char * const p

  Share   Like
Description
Discussion

There is a lot of confusion when char, const, *, p are all used in different permutations and meanings change according to which is placed where. Following article focus on differentiation and usage of all of these. 


The qualifier const can be applied to the declaration of any variable to specify that its value will not be changed. const keyword applies to whatever is immediately to its left. If there is nothing to its left, it applies to whatever is immediately to its right.


Difference between const char *p, char * const p and const char * const p : https://www.geeksforgeeks.org/difference-const-char-p-char-const-p-const-char-const-p/