0

What is the difference between the following two definitions:

char* str = "example";

and

const char* str = "example";

From what I've learnt, in the first definition, the str is bound to the address location returned by the compiler for the constant literal. And similar is the treatment for the second definition.

Sankalp
  • 2,796
  • 3
  • 30
  • 43

0 Answers0