1#include <future> // Include future
2function<int(int)> fib = // Create lambda function
3 [&](int i){
4 if (i <= 1){
5 return 1;
6 }
7 return fib(i-1)
8 + fib(i-2);
9 };
10future<int> fut = // result of async function
11 async(launch::async, fib, 4); // start async function in other thread
12// do some other work
13cout << fut.get(); // get result of async function. Wait if needed.
1int x; // Declare x to be an integer (value undefined)
2int x=255; // Declare and initialize x to 255
3short s; long l; // Usually 16 or 32 bit integer (int may be either)
4char c='a'; // Usually 8 bit character
5unsigned char u=255;
6signed char s=-1; // char might be either
7unsigned long x =
8 0xffffffffL; // short, int, long are signed
9float f; double d; // Single or double precision real (never unsigned)
10bool b=true; // true or false, may also use int (1 or 0)
11