C Get Value of Thing Pointed by Pointers

#include <iostream>

int main() {
    int variable = 42;
    int *pointer = &variable;

    // Step 1: Declare an integer variable and initialize it with the value 42.
    // Step 2: Declare an integer pointer and assign it the address of the variable.

    // Step 3: Access the value pointed to by the pointer using the dereference operator (*) and print it.
    std::cout << "Value pointed to by the pointer: " << *pointer << std::endl;

    return 0;
}