-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
36 lines (31 loc) · 1.46 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
33
34
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dpoveda- <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/15 01:14:03 by dpoveda- #+# #+# */
/* Updated: 2022/02/15 01:20:38 by dpoveda- ### ########.fr */
/* */
/* ************************************************************************** */
#include <iostream>
#include <string>
int main() {
// initialise vars
std::string string = "HI THIS IS BRAIN";
std::string *stringPTR = &string;
std::string &stringREF = string;
// print address of the string
std::cout << "\nADDRESS OF THE STRING:\n\n"
<< "string: " << &string << '\n'
<< "stringPTR: " << stringPTR << '\n'
<< "stringREF: " << &stringREF << '\n';
// display string content
std::cout << "\nCONTENT OF THE STRING:\n\n"
<< "string: " << string << '\n'
<< "stringPTR: " << *stringPTR << '\n'
<< "stringREF: " << stringREF << '\n'
<< std::endl;
return 0;
}