error: 'thread' was not declared in this scope
#include <iostream> #include <thread> void myfunction() { int nbr = 0; for(int i=0; i<1000; i++) nbr += (i%2 == 0)?1:0; } int main(int argc, const char *argv[]) { std::thread th(myfunction); th.join(); return 0; }
Report message to a moderator