Compiler and change the dialect to ISO C++11 (-std=c++11). How to I fix my eclipse to run
Fantastic news! We've Found the answer you've been seeking!
Question:
Compiler and change the dialect to ISO C++11 (-std=c++11). How to I fix my eclipse to run thread?
This is the code I am trying to run:
#include
#include
int counter = 0;
void countDown()
{
while (counter > 0)
{
counter--;
std::cout << "Count Down: " << counter << std::endl;
}
}
void countUp()
{
while (counter < 20)
{
counter++;
std::cout << "Count Up: " << counter << std::endl;
}
}
int main()
{
std::thread t1(countUp);
std::thread t2(countDown);
t1.join();
t2.join();
return 0;
}
Related Book For
Posted Date: