Please help me explain the following void function c++ code, which I did not understand. Especially for the first void function and int main(), I do not understand why the first void function enter...


Please help me explain the following void function c++ code, which I did not understand. Especially for the first void function and int main(), I do not understand why the first void function enter the number and the int main function print out the final answer.



#include
using namespace std;


void getNumber(int *input);
void doubleValue(int *val);


int main()
{
    int number;
    getNumber(&number);
    doubleValue(&number);

    cout<"that value="" doubled=""><><>

    return 0;
}
void getNumber(int *input)
{
    cout<"enter an="" integer="">
    cin>>*input;
}
void doubleValue(int *val)
{
    *val *=2;
}



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here