diff options
Diffstat (limited to 'ex02')
| -rw-r--r-- | ex02/main.cpp | 19 |
1 files 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 <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/10 11:37:18 by dkaiser #+# #+# */ -/* Updated: 2025/02/10 11:37:44 by dkaiser ### ########.fr */ +/* Updated: 2025/02/10 11:47:15 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ +#include <string> +#include <iostream> + 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; +} |
