Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ start thread later

#include <iostream>
#include <thread>

void thread_func(const int i) {
    std::cout << "hello from thread: " << i << std::endl;
}

int main() {
    std::thread t;

    t = std::thread{ thread_func, 7 };
    t.join();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #start #thread
ADD COMMENT
Topic
Name
5+4 =