c 2b 2b start thread later

Solutions on MaxInterview for c 2b 2b start thread later by the best coders in the world

showing results for - "c 2b 2b start thread later"
Mélissa
07 Apr 2020
1#include <iostream>
2#include <thread>
3
4void thread_func(const int i) {
5    std::cout << "hello from thread: " << i << std::endl;
6}
7
8int main() {
9    std::thread t;
10
11    t = std::thread{ thread_func, 7 };
12    t.join();
13}