You can not return an array this way. Even if you could, it would be ineffective - better retur only a pointer to an array.