From: Dominik Kaiser Date: Mon, 10 Feb 2025 10:48:00 +0000 (+0100) Subject: Finish ex02 X-Git-Url: https://git.dkaiser.de/?a=commitdiff_plain;h=6bd5ae5bfc004765b617e1b39111ed565a75b4e3;p=42%2Fcpp01.git Finish ex02 --- 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; +}