get data from terminal c++

#include <iostream>
#include <string>

int main() {
    // Declare variables to store user input
    int integerValue;
    double doubleValue;
    std::string stringValue;

    // Prompt the user for an integer value
    std::cout << "Enter an integer: ";
    std::cin >> integerValue;

    // Prompt the user for a double value
    std::cout << "Enter a double: ";
    std::cin >> doubleValue;

    // Clear the input buffer to handle newline characters
    std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

    // Prompt the user for a string value
    std::cout << "Enter a string: ";
    std::getline(std::cin, stringValue);

    // Display the entered values
    std::cout << "Integer: " << integerValue << std::endl;
    std::cout << "Double: " << doubleValue << std::endl;
    std::cout << "String: " << stringValue << std::endl;

    return 0;
}