From a450487a18ec72ea3a3815bfaf17b2f701796b6f Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 31 Jul 2024 17:09:45 +0200 Subject: more --- 2p35.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 2p35.cpp (limited to '2p35.cpp') diff --git a/2p35.cpp b/2p35.cpp new file mode 100644 index 0000000..ce34e47 --- /dev/null +++ b/2p35.cpp @@ -0,0 +1,28 @@ +#include +#include "sales_item.hpp" + +/* + * + * 2.35 + * + * + */ + +int main () { + + const int i = 42; // const int + auto j = i; // int + const auto &k = i; // const int& + auto *p = &i; // pointer to const int? (const int*) or pointer to pointer? + auto p2 = &i; + const auto j2 = i, &k2 = i; + // const int // reference to const int (const int&) + std::cout << i << "\n" + << j << "\n" + << k << "\n" + << p << "\n" + << p2 << "\n" + << j2 << "\n" + << k2 << std::endl; + return 0; +} -- cgit v1.2.3