Dear All,
I want to write a function that returns an array of integers but I have a problem with the function definition
How can I define this function?Code:array <int> f(int a, int b, int c) { . . }
Thanks
Dear All,
I want to write a function that returns an array of integers but I have a problem with the function definition
How can I define this function?Code:array <int> f(int a, int b, int c) { . . }
Thanks
You can't return an array in C++, so you have to return a pointer to the first element. A vector<> is better if youhave a choice:Code:int *f( int a, int b, int c );
Code:vector<int> f( int a, int b, int c );