char a1[] = "My name is Peter!";
char *a2 = "My name is Peter!";
*a1 = 'm';
a2[0] = 'm';
Array declaration creates allocates chars required for the string, and can read/write.
But char* creates a pointer, and it locates to a constant memory, where "My Name is Peter" is copied.
This memory cannot be overwritten.
Considering sizeof these declarations, char* a will give the size of a pointer, usually 4 bytes.
char[] declaration will give the entire size of the string.
Please refer the following link.
Difference between pointer and array [duplicate][
^]