computeCube function is correct, but the main function has a problem. Explain why it doesn't work and show how to fix it. Your fix must be to the main function only; you must not change computeCube.
void computeCube(int n, int* ncubed)
{
*ncubed = n * n * n;
}
int main()
{
int* ptr;
computeCube(5, ptr);
cout << "Five cubed is " << *ptr << endl;
}
Thanks