main.cpp 1.4 KB

123456789101112131415161718192021222324252627282930
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* main.cpp :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@gmail.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2025/07/15 14:57:39 by bchanot #+# #+# */
  9. /* Updated: 2025/07/15 15:14:56 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include <iostream>
  13. int main(void) {
  14. std::string str = "HI THIS IS BRAIN";
  15. std::string *stringPTR = &str;
  16. std::string &stringREF = str;
  17. std::cout << &str << " | str address" << std::endl;
  18. std::cout << &stringPTR << " | stringPTR address" << std::endl;
  19. std::cout << &stringREF << " | stringREF address" << std::endl;
  20. std::cout << str << "| str value" << std::endl;
  21. std::cout << *stringPTR << "| stringPTR value" << std::endl;
  22. std::cout << stringREF << "| stringVAR value" << std::endl;
  23. return 0;
  24. }