Is it safe to do something like the following?
#include #include #include int main(void) { char* msg;
The first version is not safe. And, msg should be pointing to valid memory location for "Hello World!!!" to get copied.
msg
char* msg = (char*)malloc(sizeof(char) * 15); strcpy(msg, "Hello World!!!");