What is the difference between `const char* ptr` and `char* const ptr` in C++?

1 Answers
Answered by suresh

```html

Understanding the Difference Between const char* ptr and char* const ptr in C++

Understanding the Difference Between const char* ptr and char* const ptr in C++

The focus keyword for this topic is C++ pointer.
In C++, const char* ptr declares a pointer to a constant character, meaning the pointer itself can be modified but the pointed-to character value cannot be changed. On the other hand, char* const ptr declares a constant pointer to a character, where the pointer's address cannot be modified but the pointed-to value can be changed.

```

Answer for Question: What is the difference between `const char* ptr` and `char* const ptr` in C++?