I know the difference between:
char *a = "string";
char p[] = "string";
from *a
, it acts as the following...
+-----+ +---+---+---+---+---+---+---+
a: | *======> | s | t | r | i | n | g |\0 |
+-----+ +---+---+---+---+---+---+---+
If I want to create another variable say
char *b;
and I hope it copies all contents in pointer a points to instead of pointing to the a's content.
+-----+ +---+---+---+---+---+---+---+
a: | *======> | s | t | r | i | n | g |\0 |
+-----+ +---+---+---+---+---+---+---+
b: | *======> | s | t | r | i | n | g |\0 |
+-----+ +---+---+---+---+---+---+---+
How to do this ?