what is the difference between char*a and char a[]
why is one used as a parameter in the function?
Character array
READ THIS :
char str[] = “Test”;
is an array of five characters, initialized with the value “Test” plus the null terminator ‘\0’.
The second
char *str = “Test”;
is a pointer to the memory location of the literal string “Test”.
sizeof pointer 4.
Both can be used as parameter .