void getMem(char *ptr){ ptr = (char*)malloc(100);}main(){ char *str = NULL; getMem(str); strcpy(str, "Hello C/C++ programming"); printf("%s\n", str);}
No comments:
Post a Comment