CPP01/ex02/src/main.cpp
2025-03-21 16:59:41 +01:00

29 lines
1.5 KiB
C++

/* ************************************************************************** */
/* */
/* :::::::: */
/* main.cpp :+: :+: */
/* +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/03/21 16:06:06 by whaffman #+# #+# */
/* Updated: 2025/03/21 16:12:28 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#include <iostream>
#include <string>
int main()
{
std::string string = "HI THIS IS BRAIN";
std::string *stringPTR = &string;
std::string &stringREF = string;
std::cout << "Address of the string: " << &string << std::endl;
std::cout << "Address held by stringPTR: " << stringPTR << std::endl;
std::cout << "Address held by (of) stringREF: " << &stringREF << std::endl;
std::cout << "Value of string: " << string << std::endl;
std::cout << "Value pointed bystringPTR: " << *stringPTR << std::endl;
std::cout << "Value of stringREF: " << stringREF << std::endl;
}