Programming Tips - gcc: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]

Date: 2021nov1 Update: 2025sep15 Language: C/C++ Q. gcc: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] How can I correct this error. A. If you have something like:
char *mystring = "hello";
The problem is that "hello" is constant but mystring isn't. So change it to:
const char *mystring = "hello";
Add a `const`. It makes since since the quoted string is a constant.