I am expecting that both following vectors have the same representation in RAM:
char a_var[] = \"XXX\\x00\";
char *p_var = \"XXX\";
But st
As others said, char *p_var = "XXX"; creates a pointer to a string literal that can't be changed, so compiler implementations are free to reuse literals, for example:
char *p_var = "XXX";
char *other = "XXX";
A compiler could choose to optimize this by storing "XXX" only once in memory and making both pointers point to it, modifying their value could lead to unexpected behavior, so that's why you should not try to modify their contents.