class testa
{
public:
testa_b();
~testa_b();
testa_c();
}
Then I have defined some variables in testa_b:
1 2 3 4
testa::testa_b()
{
double aa = 1.0;
}
What is the easiest way to make testa_c() can use the aa defined in testa_b() (without declaring them in the class)? Could anyone please let me know? Thanks!
aa defined in testa_b is function local. That means it will be detroyed when function ends. You can return this value as result of function and use it like
1 2 3 4
testa_c()
{
double x = testa_b()
}
Actualyy your functions have an error: your constructor and destructor should be named testa()/~testa()
And other functions should have a return type.
Thanks. In case I have a lot of variables to define, I think it's better to define them in the class. So the other functions can access. Right?
I don't want to have 50 arguments in a function...
Sorry for the errors. I wrote them too fast... :(