From 6bd5ae5bfc004765b617e1b39111ed565a75b4e3 Mon Sep 17 00:00:00 2001 From: Dominik Kaiser Date: Mon, 10 Feb 2025 11:48:00 +0100 Subject: [PATCH] Finish ex02 --- ex02/main.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ex02/main.cpp b/ex02/main.cpp index 188eb5b..533436d 100644 --- a/ex02/main.cpp +++ b/ex02/main.cpp @@ -6,9 +6,24 @@ /* By: dkaiser +#include + int main(void) -{} +{ + std::string str = "HI THIS IS BRAIN"; + std::string* stringPTR = &str; + std::string& stringREF = str; + + std::cout << "Address of str: " << &str << std::endl; + std::cout << "Address held by stringPTR: " << stringPTR << std::endl; + std::cout << "Address held by stringREF: " << &stringREF << std::endl; + + std::cout << "Value of str: " << str << std::endl; + std::cout << "Value pointed to by stringPTR: " << *stringPTR << std::endl; + std::cout << "Value pointed to by stringREF: " << stringREF << std::endl; +} -- 2.47.2