using the std #include how would i return a value if I want a thread to run it?
For example
include <iostream>
#include <thread>
usingnamespace std;
int func(int a)
{
int b = a*a
return b;
}
int main()
{
thread t(func);
t.join();
return 0;
}
How would I modify
thread t(func);
so that I can get b