1
0
This repository has been archived on 2024-11-25. You can view files and clone it, but cannot push or open issues or pull requests.
CPP_Module_01/ex02/main.cpp

31 lines
1.5 KiB
C++
Raw Permalink Normal View History

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 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;
}