Returning short int arr in a function

I'm trying to return a short int in a function

This is my function signature :
 
short int* StartRecord(int seconds)


this is my array :
 
short int waveIn[NUMPTS]; 


I'm trying to get the data into an array :
 
short int arr [] = StartRecord(3);


getting this error :
Error 2 error C2440: 'initializing' : cannot convert from 'short *' to 'short []'

Why is that?

Thanks!
Arrays cannot be copied, so you cannot return them from a function.

You'll either have to use a container class (like std::array or std::vector) or will have to pass a pointer to the array into the function as a parameter.
Topic archived. No new replies allowed.