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.
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.