-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
32 lines (26 loc) · 1.45 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zelhajou <zelhajou@student.1337.ma> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/06 15:22:12 by zelhajou #+# #+# */
/* Updated: 2024/06/08 10:59:22 by zelhajou ### ########.fr */
/* */
/* ************************************************************************** */
#include <iostream>
#include <string>
int main()
{
std::string brain = "HI THIS IS BRAIN";
std::string* stringPTR = &brain;
std::string &stringREF = brain;
std::cout << "Address of brain: " << &brain << std::endl;
std::cout << "Address held by stringPTR: " << stringPTR << std::endl;
std::cout << "Address held by stringREF: " << &stringREF << std::endl;
std::cout << "Value of brain: " << brain << std::endl;
std::cout << "Value pointed to by stringPTR: " << *stringPTR << std::endl;
std::cout << "Value pointed to by stringREF: " << stringREF << std::endl;
return (0);
}