feat(ex02): it works

This commit is contained in:
Khaïs COLIN 2025-05-12 13:09:10 +02:00
parent 1a167101bb
commit 8f7b9c3068
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
3 changed files with 53 additions and 0 deletions

14
ex02/main.cpp Normal file
View file

@ -0,0 +1,14 @@
#include <iostream>
int main(void) {
std::string string = "HI THIS IS BRAIN";
std::string *stringPTR = &string;
std::string &stringREF = string;
std::cout << "address of string: " << &string << std::endl;
std::cout << "address held by stringPTR: " << stringPTR << std::endl;
std::cout << "address held by stringREF: " << &stringREF << std::endl;
std::cout << "value of string: " << string << std::endl;
std::cout << "value pointed by stringPTR: " << *stringPTR << std::endl;
std::cout << "value pointed by stringREF: " << stringREF << std::endl;
return 0;
}