summaryrefslogtreecommitdiff
path: root/ex02
diff options
context:
space:
mode:
authorDominik Kaiser2025-02-10 11:48:00 +0100
committerDominik Kaiser2025-02-10 11:48:00 +0100
commit6bd5ae5bfc004765b617e1b39111ed565a75b4e3 (patch)
tree279446e1b1b23bb38f7fdcf8d639ac6d64e19b18 /ex02
parent59d18d71067e553d88e4d156ec451739c1e2e906 (diff)
downloadcpp01-6bd5ae5bfc004765b617e1b39111ed565a75b4e3.tar.gz
cpp01-6bd5ae5bfc004765b617e1b39111ed565a75b4e3.zip
Finish ex02
Diffstat (limited to 'ex02')
-rw-r--r--ex02/main.cpp19
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;
+}