From e61e04619d0c9dd4d079532eff3483e234fc8acd Mon Sep 17 00:00:00 2001 From: hybrid Date: Mon, 24 Aug 2026 00:48:14 +0300 Subject: add: lesson{5,6}, CMakeLists.txt --- src/chapter1/lesson6/uninit_var.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/chapter1/lesson6/uninit_var.cpp (limited to 'src/chapter1/lesson6') diff --git a/src/chapter1/lesson6/uninit_var.cpp b/src/chapter1/lesson6/uninit_var.cpp new file mode 100644 index 0000000..603b8e0 --- /dev/null +++ b/src/chapter1/lesson6/uninit_var.cpp @@ -0,0 +1,12 @@ +#include + +int main() +{ + // define an integer variable named x + int x; // this variable is uninitialized because we haven't given it a value + + // print the value of x to the screen + std::cout << x << '\n'; // who knows what we'll get, because x is uninitialized + + return 0; +} -- cgit v1.3.1