C++ return an array by reference
Use this trick declaration to return a reference of an array:
char ( &GetArray() )[6]
{
static char hello[] = "hello";
return hello;
}
char ( &GetArray() )[6]
{
static char hello[] = "hello";
return hello;
}
<< Home