-2

Consider:

void Function()
{
     while (true)
     {
          // Doing stuff
     }
}


int maincodeeee()
{
     Function();

     std::cout << "blablabal" << std::endl;
}

How can I launch Function() in a separate thread, but still continue the code in maincodeeee()?

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
  • Re *"...separate thread"*: What is kind of system is it? For example, operating system (incl. version). Is a threading library in use? What compiler/system, incl. version? What version of C++ is it supposed to be? – Peter Mortensen May 11 '22 at 13:34

0 Answers0