aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.com>2021-06-26 01:05:25 +0300
committerkaotisk <kaotisk@arching-kaos.com>2021-06-26 01:05:25 +0300
commitf539e44e61bd0e1956556eec16a4a985bbf7799d (patch)
tree47b5fe2bedc8e6fa0205c5d0f25947d6636e7ccf
parent41b3fced89c912377a6cf6d595c5c7b58353d47d (diff)
downloadcfun-master.tar.gz
cfun-master.tar.bz2
cfun-master.zip
Template experimentHEADgito/mastermaster
-rw-r--r--main1.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/main1.cpp b/main1.cpp
index 3af30cf..8534745 100644
--- a/main1.cpp
+++ b/main1.cpp
@@ -1,5 +1,23 @@
#include <iostream>
+#include <vector>
+#include <string>
+
+template <class T>
+T h (T i){
+ return i;
+}
int main(){
- return 1;
+ std::string v;
+ bool keep = true;
+ std::cout << "Welcome to template experiment\n";
+ std::cout << "Stop the program by writting quit anywhere in the text\n";
+ while (keep){
+ std::cout << "Write something :";
+ std::cin >> v;
+ std::cout << "You wrote: " << h(v) << "\n";
+ if (v=="quit")
+ keep = false;
+ }
+ return 0;
}