[Solved] How is “a” used in my program?


You declare an uninitialized variable of type int with identifier a:

int a;

The user provides a value to a.

std::cin >> a;

A copy is returned from the function:

return a;

Calls to the getValueFromUser() will create a temporary a,
assign it to user input, and return it each time.

solved How is “a” used in my program?