I've been trying to pass a short int *, an array of short ints to an std::thread, but the array is somehow corrupted, or not passing right into the thread..
Why is that? the name of the array is a pointer to the first cell, so I guess it is being passed by reference, right ?
Here is my code :
short int waveIn[NUMPTS];
// doing sutff with the array
std::thread t1(toString, waveIn);
t1.detach();
and the thread function :
void toString(short int *waveIn)
{
// doing stuff with the array
}
But all the array cells are -1308, where I checked before passing the array into the thread, the array cells where somethnig else...
What is my problem?
Thanks!