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="">"that><><> return 0;}void getNumber(int *input){ cout<"enter an="" integer="">"enter> cin>>*input;}void doubleValue(int *val){ *val *=2;}
void getNumber(int *input);void doubleValue(int *val);
int main(){ int number; getNumber(&number); doubleValue(&number); cout<"that value="" doubled="">"that><><> return 0;}void getNumber(int *input){ cout<"enter an="" integer="">"enter> cin>>*input;}void doubleValue(int *val){ *val *=2;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here