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
This is a discussion on Array as a declaration specifier within the C++ Programming forums, part of the General Programming Boards category; Dear All, I want to write a function that returns an array of integers but I have a problem with ...
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 );