1//Function declaration
2char* testfunc()
3{
4 char* str = malloc(10 * sizeof(char));
5 return str;
6}
7
8//Calling the function
9foo = testfunc();
10// Do something with your foo
11free(foo); //It is required to free() memory to avoid memory lead