I am a total C++ noob, and I am having some trouble returning an array from my methods. I have a header file with the following method declaration:
virtual double[]
echoDoubleArray(double[] doubleArray, int arraySize) throw (RemoteException);
This gives me the following error:
../common/EchoService.h: At global scope:
../common/EchoService.h:25: error: expected unqualified-id before ‘[’ token
What is the correct way to return an array?
C++ doesn’t play nice with non-local arrays, more likely you should be using an actual container like
std::array<double,10>orstd::vector<double>. I don’t think it’s possible to return an array from a function.