diff options
| author | Dominik Kaiser | 2025-02-10 11:48:00 +0100 |
|---|---|---|
| committer | Dominik Kaiser | 2025-02-10 11:48:00 +0100 |
| commit | 6bd5ae5bfc004765b617e1b39111ed565a75b4e3 (patch) | |
| tree | 279446e1b1b23bb38f7fdcf8d639ac6d64e19b18 /ex02 | |
| parent | 59d18d71067e553d88e4d156ec451739c1e2e906 (diff) | |
| download | cpp01-6bd5ae5bfc004765b617e1b39111ed565a75b4e3.tar.gz cpp01-6bd5ae5bfc004765b617e1b39111ed565a75b4e3.zip | |
Finish ex02
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; +} |
