I have two variables in two different functions, I'd like to store them in the third function without using global variables. How to do it?
something like this
void function1() {
a = 1;
b = 2;
}
void function2() {
c = 3;
d = 4;
}
void function3 () {
cout << a;
cout << b;
cout << c;
cout << d;
}
function1ora, it's hard to give you an appropriate answer that does not only cover the "what's possible" aspect but also the "what's useful" aspect.