31 lines
1.5 KiB
C++
31 lines
1.5 KiB
C++
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* main.cpp :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2024/11/04 19:01:36 by adjoly #+# #+# */
|
||
|
/* Updated: 2024/11/04 19:15:33 by adjoly ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include <iostream>
|
||
|
#include <string>
|
||
|
|
||
|
int main(void) {
|
||
|
std::string str = "HI THIS IS BRAIN";
|
||
|
std::string *stringPTR = &str;
|
||
|
std::string &stringREF = str;
|
||
|
|
||
|
std::cout << "The address of the string : " << &str << std::endl;
|
||
|
std::cout << "The address of the string pointer : " << stringPTR << std::endl;
|
||
|
std::cout << "The address of the string reference : " << &stringREF << std::endl;
|
||
|
|
||
|
std::cout << std::endl;
|
||
|
|
||
|
std::cout << "The value of the string : " << str << std::endl;
|
||
|
std::cout << "The value pointed to by stringPTR : " << *stringPTR << std::endl;
|
||
|
std::cout << "The value pointed to by stringREF : " << stringREF << std::endl;
|
||
|
}
|