From 79ed419f4219618a5da51788a58a21a1f03ea582 Mon Sep 17 00:00:00 2001 From: bartvbl <bartvblokl@gmail.com> Date: Wed, 22 Jan 2025 22:06:13 +0100 Subject: [PATCH] vector handout for lecture 5 --- .../Handout - vectors/main.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 templates/_folder_Lectures/_folder_Lecture 05/Handout - vectors/main.cpp diff --git a/templates/_folder_Lectures/_folder_Lecture 05/Handout - vectors/main.cpp b/templates/_folder_Lectures/_folder_Lecture 05/Handout - vectors/main.cpp new file mode 100644 index 0000000..65e3d74 --- /dev/null +++ b/templates/_folder_Lectures/_folder_Lecture 05/Handout - vectors/main.cpp @@ -0,0 +1,18 @@ +#include <iostream> + +int main() { + std::string todoList = "buy soap\nbuy rice\ndo laundry\naccidentally publish exam on blackboard\ninvent mind control device\nprepare world domination victory speech\ncall mom\n"; + std::string input; + while(true) { + std::cout << "? "; + getline(std::cin, input); + if(input == "quit") { + break; + } + todoList += input + '\n'; + std::cout << "--- TODO list ---" << std::endl; + std::cout << todoList << std::endl; + } + + return 0; +} \ No newline at end of file -- GitLab