What's the difference between
char *Name;
Name = malloc (13*sizeof(char));
strcpy (Name, "George Brown");
and
char Name[13];
strcpy (Name, "George Brown");
The compiler gives a warning in the second case: warning C4047: 'function' : 'char *' differs in levels of indirection from 'char *[13]'
& warning C4024: 'strcat' : different types for formal and actual parameter 1
. The warning goes away if we cast the static array as (char*)
. Is it dangerous though?