what do have to do?

Hellofire1234,

Since there is not enough code to compile and test I would have to guess that "main" calls "whatsx", which is only a copy of the variable,, but the function does return the input to somewhere.

Having no idea where "x" is defined again I would guess that "showx" would need to have the variable "x" passed to the function.

Andy
fire1234

Op Original post.

1
2
3
4
5
6
7
8
9
10
11
int whatsx(int x)
{
     std::cin >> x;

    return x;
}

void showx(int num)
{
    std::cout << x;
}
Topic archived. No new replies allowed.