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

28 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;
}