#include <iostream> using namespace std; void GetMemory(char **p, int num) { *p = (char *)malloc(num); } void Test(void) { char *str = NULL; GetMemory(&str, 100); strcpy(str, "hello"); cout<<str<<endl; } int main() { Test(); return 0; }