How can I return values from my_func by parameter? Application crashes during printf. I don't know why, I thought that *abc will be pointer to xxx...
void my_func(int *_return)
{
int *xxx = new int[5];
for (int i = 0; i < 5; i++) xxx[i] = 100+i;
_return = xxx;
return;
}
int _tmain(int argc, _TCHAR* argv[])
{
int *abc = NULL;
my_func(abc);
printf("%d", abc[2]);
return 0;
}
std::vector<int> my_func()and be happy_returnto*_return(yes, even where you already have one*preceding it). In addition, changemy_func(abc)tomy_func(&abc).