From 642720852ec17b68d8d2bbad300202604c0bb63d Mon Sep 17 00:00:00 2001 From: Oskar Date: Tue, 30 Jul 2024 17:01:04 +0200 Subject: more exercises --- 2p25.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 2p25.cpp (limited to '2p25.cpp') diff --git a/2p25.cpp b/2p25.cpp new file mode 100644 index 0000000..e97dec3 --- /dev/null +++ b/2p25.cpp @@ -0,0 +1,27 @@ +#include +#include "sales_item.hpp" + +/* + * + * 2.25 + * + * + */ + +int main () { + + int *p = nullptr; + int i = 10; + int &r = i; + // addr 10 10 + std::cout << &p << " " << i << " " << r << std::endl; + + int i2 = 11; + int *ip = 0; // AKA nullptr AKA NULL + std::cout << i2 << " " << &ip << std::endl; + + int *ip2 = nullptr; + int ip3 = 99; + std::cout << ip3 << " " << &ip2 << std::endl; + return 0; +} -- cgit v1.2.3