In my main function I am trying to make a thread and pass down a string a array to it by doing this
int main()
{
thread DoNotWork(Print,Pages);
}
my function is this
void Print(string Pages [])
The error message is this
error: no matching function for call to ‘std::thread::thread(void (&)(std::string*), std::string [BufferSize])’
thread DoNotWork(Print,Pages);
int main()
{
int BufferSize = 5;
string Pages[BufferSize];
thread down(downloader,Pages,BufferSize,5);
}
When I am trying to make a thread like this it gives me an error and I do not know why
this is the error message
error: no matching function for call to ‘std::thread::thread(void (&)(std::string*, int, int), std::string [BufferSize], int&, int)’
thread down(downloader,Pages,BufferSize,5);
The var BufferSize will be 5 for the whole program. I am passing the size of the array with the command line. Do you know why I get this error when using threads???