1
0
Fork 0
This repository has been archived on 2021-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
uni-m.cds-adv-prog/ex9.1/b.cpp
Eric Teunis de Boone d9d2d5f18f Finished Ex9.*
2020-01-07 11:01:08 +01:00

27 lines
364 B
C++
Executable file

#include <thread>
#include <string>
#include <iostream>
/*
* Compile with 'g++ -pthread b.cpp'
*
* This gets an error 'terminate called without an active exception'
*/
using namespace std;
void f1() {
cout << "Hello ";
}
void f2(const std::string& s) {
cout << s << endl;
}
int main() {
thread t1(f1);
thread t2{f2, "Parallel World!"};
return 0;
}