Hi I am pretty new to C and was wondering how to return an entire array. For example I have this function here.
char* foo(int x)
{
    char *num = (char*)malloc(x*sizeof(int));
    
    num[0] = '1';
    num[1] = '2';
    num[2] = '3';
    num[3] = '4';
    return num;
    
}  
I realized that when I return num it only returns the first index of num. But is there any way to return the whole array, 1234? Any help will be greatly appreciated!
 
     
    