#include <iostream>
#include <cstdlib>
int squareValue(int *value);
int main() {
int number = 5;
int *numberPtr = &number;
std::cout << "number is " << *numberPtr << std::endl;
std::cout << "If use it in a method " << std::endl;
int squaredNumber = squareValue(&number);
std::cout << "The square of number is " << squaredNumber << std::endl;
std::cout << "The number after squaring is " << number << std::endl;
std::cout << "Press enter to continue...";
std::cin.ignore();
return EXIT_SUCCESS;
}
int squareValue(int *value) {
int squared = (*value) * (*value);
return squared;
}