You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

33 lines
1.3 KiB

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/14 11:01:07 by narnaud #+# #+# */
/* Updated: 2022/07/18 08:31:12 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
#include <iostream>
using std::string;
using std::cout;
using std::endl;
int main(void)
{
string str = "HI THIS IS BRAIN";
string *stringPTR = &str;
string &stringREF = str;
cout << &str << endl;
cout << stringPTR << endl;
//cout << &stringPTR << endl;
cout << &stringREF << endl;
cout << str << endl;
cout << *stringPTR << endl;
//cout << stringPTR << endl;
cout << stringREF << endl;
}