char *str = "This is string";
Puts the string in the constant data section (also known as .rdata)
of the program.This data can't be modified.
char str2[20] = "This is string";
In this type of declaration data is preferably stored in the stack area
of the program, if declared inside the function scope
and in data section
if declared in global scope
.This data can be modified.
So if you have a necessity to modify data then use the second approach.