From 40d826263520ff8def841d1832fd93329c90e790 Mon Sep 17 00:00:00 2001 From: FarawayPlayer <79670835+FarawayPlayer@users.noreply.github.com> Date: Tue, 26 Aug 2025 15:46:08 +0000 Subject: [PATCH 1/3] commit --- src/Ch00/CodeDemo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ch00/CodeDemo.cpp b/src/Ch00/CodeDemo.cpp index 2613d2c3..613e0ee0 100644 --- a/src/Ch00/CodeDemo.cpp +++ b/src/Ch00/CodeDemo.cpp @@ -1,5 +1,5 @@ // Learning C++ -// Exercise 00_03 +// Exercise 00_03 with modifications // Using the exercise files on GitHub, by Eduardo CorpeƱo #include From 19f35e65d61356f4fbebb133286bcd7e50aad9bc Mon Sep 17 00:00:00 2001 From: FarawayPlayer <79670835+FarawayPlayer@users.noreply.github.com> Date: Wed, 27 Aug 2025 00:17:20 +0000 Subject: [PATCH 2/3] Excercise on variables --- src/Ch02/02_03b/CodeDemo.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Ch02/02_03b/CodeDemo.cpp b/src/Ch02/02_03b/CodeDemo.cpp index 8b365648..90518785 100644 --- a/src/Ch02/02_03b/CodeDemo.cpp +++ b/src/Ch02/02_03b/CodeDemo.cpp @@ -4,9 +4,27 @@ #include +int a, b = 5; // single line comment + +/* Multi +* line +* comment */ + int main(){ - std::cout << "Hi There!" << std::endl; - + bool my_flag; + a = 7; + my_flag = false; + std::cout << "a = " << a << std::endl; + std::cout << "b = " << b << std::endl; + std::cout << "flag = " << my_flag << std::endl; + my_flag = true; + std::cout << "flag = " << my_flag << std::endl; + std::cout << "a + b = " << a + b << std::endl; + std::cout << "b - a = " << b - a << std::endl; + unsigned int positive; + positive = b - a; + std::cout << "b - a (unsigned) = " << positive << std::endl; + std::cout << std::endl << std::endl; return (0); } From 6b73891a90283d14e01ad7670b0fa730aaef7f55 Mon Sep 17 00:00:00 2001 From: FarawayPlayer <79670835+FarawayPlayer@users.noreply.github.com> Date: Wed, 27 Aug 2025 00:24:26 +0000 Subject: [PATCH 3/3] Excercise type id --- src/Ch02/02_05b/CodeDemo.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Ch02/02_05b/CodeDemo.cpp b/src/Ch02/02_05b/CodeDemo.cpp index eed63d20..b6104f1e 100644 --- a/src/Ch02/02_05b/CodeDemo.cpp +++ b/src/Ch02/02_05b/CodeDemo.cpp @@ -6,7 +6,22 @@ #include int main(){ - + auto a = 8; + auto b = 12345678901; + auto c = 3.14f; + auto d = 3.14; + auto e = true; + auto f = 'd'; + auto g = "C++ rocks!"; + + std::cout << "The type of a is " << typeid(a).name() << std::endl; + std::cout << "The type of b is " << typeid(b).name() << std::endl; + std::cout << "The type of c is " << typeid(c).name() << std::endl; + std::cout << "The type of d is " << typeid(d).name() << std::endl; + std::cout << "The type of e is " << typeid(e).name() << std::endl; + std::cout << "The type of f is " << typeid(f).name() << std::endl; + std::cout << "The type of g is " << typeid(g).name() << std::endl; + std::cout << std::endl << std::endl; return (0); }