28 lines
1.4 KiB
C++
Executable File
28 lines
1.4 KiB
C++
Executable File
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.cpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: lfirmin <lfirmin@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/07/01 16:27:39 by lfirmin #+# #+# */
|
|
/* Updated: 2025/07/01 16:34:32 by lfirmin ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
# include <iostream>
|
|
int main(void)
|
|
{
|
|
std::string str = "HI THIS IS BRAIN";
|
|
std::string *stringPTR = &str;
|
|
std::string &stringREF = str;
|
|
|
|
std::cout << "Memory address of str: " << &str << std::endl;
|
|
std::cout << "Memory address of stringPTR: " << stringPTR << std::endl;
|
|
std::cout << "Memory address of stringREF: " << &stringREF << std::endl;
|
|
|
|
std::cout << "Value of str: " << str << std::endl;
|
|
std::cout << "Value of stringPTR: " << *stringPTR << std::endl;
|
|
std::cout << "Value of stringREF: " << stringREF << std::endl;
|
|
|
|
} |