If it's a local variable, you don't. If it's dynamic memory or static memory, you can just pass a pointer to it. Three examples:
Code:
char* funct()
{
char array[SOME_MAX_SIZE];
strcpy(array,"My Buggy message");
/* This is a bug. Don't do this in your code */
/* the storage for array does not stay in scope, so you
can't return it */
return array;
}
static char array[SOME_MAX_SIZE];
char* funct1()
{
strcpy(array, "But this is okay");
return array;
}
/* Or... */
char* funct2()
{
char* array = (char*)malloc(SOME_MAX_SIZE);
strcpy(array,"This is also okay");
return array;
}