// © Copyrights 2026 Praajna Pattada

#include <iostream>
#include <string>
#include <limits>

void displayText(std::string* text)
{
    std::cout << "The text you have entered is: " << *(text) << '\n'; //  Get the value stored at the memory address of the given pointer (i.e., p)
    std::cout << "The memory address of the string is: " << text << '\n';  // Display the memory address of the given pointer
}

int main()
{
    std::string Text;
    std::string* p { &Text };
    std::cout << "Enter a line of text: ";
    std::getline(std::cin >> std::ws, Text);
    displayText(p);
    
    std::cin.clear();
    std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
    std::cin.get();
    return 0;
}
