From ea645e96d93cbe3d3903875392d1dd36d65135bb Mon Sep 17 00:00:00 2001 From: "Stephen M. McQuay" Date: Sat, 5 May 2012 09:15:15 -0600 Subject: [PATCH] Added tuple example. --- tuple.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tuple.cc diff --git a/tuple.cc b/tuple.cc new file mode 100644 index 0000000..1254a5d --- /dev/null +++ b/tuple.cc @@ -0,0 +1,18 @@ +#include +#include + +using namespace std; + +// make a function that returns multiple values + +int main() { + tuple c = make_tuple(5, 4); + cout << get<0>(c) << endl; + + int a = 0; + int b = 1; + cout << a << endl; + cout << b << endl; + // swap a, b + // get a,b from func ... +}