Follow Us
Contribute
  • Register
Errorbase is a collaborative writing project, that aims to build the largest trouble-shooting guide about all kinds of error messages.

Categories

+2 votes
Hi,
Can anybody explain  how the value of one member function variables can be called in other member  function in same class...
requested by
edited by

1 Solution

0 votes

If you are asking how to reach one variable in one function from the other one, then it is not possible. The scope of the variable is only inside of the block where it is defined. Outside of the block you can't get the value or reach the variable.

 

The only way is to call the other function and pass the argument by value. This topic has been covered detailly below:

 

http://www.cplusplus.com/doc/tutorial/functions2/

 

This is the ultimate resource for c++.

 

You can also provide the code to get more help about the subject.

solved by (560 points)
...