InterviewSolution
Saved Bookmarks
| 1. |
How Can A C++11 Thread Be Created With A Lambda? |
|
Answer» #INCLUDE "stdafx.h" #include <thread> #include <iostream> using namespace std; int main() { thread t1([] { cout << "Launching SCUD missile" << endl; }); t1.join(); RETURN 0; } #include "stdafx.h" #include <thread> #include <iostream> using namespace std; int main() { thread t1([] { cout << "Launching Scud missile" << endl; }); t1.join(); return 0; } |
|