From 3796cd76fd111dc6fb7f5ecbe070aa114b922d0c Mon Sep 17 00:00:00 2001 From: stevenanthonyrevo Date: Fri, 6 Oct 2023 13:57:16 -0400 Subject: [PATCH 1/2] Adding Standard Input Stream to String Category --- String/standard_input_stream.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 String/standard_input_stream.cpp diff --git a/String/standard_input_stream.cpp b/String/standard_input_stream.cpp new file mode 100644 index 0000000..b19746c --- /dev/null +++ b/String/standard_input_stream.cpp @@ -0,0 +1,8 @@ +#include + +int main() { + int price; + std::cout << "Enter the price: "; + std::cin >> price; + std::cout << "User entered the price " << price << std::endl; +} From 5434a5c3481b365f229bfb5a65d2d942e89e7080 Mon Sep 17 00:00:00 2001 From: stevenanthonyrevo Date: Sun, 8 Oct 2023 20:58:37 -0400 Subject: [PATCH 2/2] Added Multi-line Comments and Single Line Comments --- String/standard_input_stream.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/String/standard_input_stream.cpp b/String/standard_input_stream.cpp index b19746c..08aac81 100644 --- a/String/standard_input_stream.cpp +++ b/String/standard_input_stream.cpp @@ -1,8 +1,19 @@ #include +/* The following code is an example which use cin to write the captured input via the terminal to the input stream + and then displays the captured input via cout to the output stream. + + link: https://en.cppreference.com/w/cpp/header/iostream +*/ + int main() { int price; + + // Writes to the standard C output stream std::cout << "Enter the price: "; + + // Reads from the standard C input stream std::cin >> price; + std::cout << "User entered the price " << price << std::endl; }