Hello
I wanna know if is possible to change a value of a method using another function.
Example
Can I change the x to another value using a new method?Code:int myclass::somefunc() { int x =10; return x; }
If yes, how can i do it?
Thanks
Hello
I wanna know if is possible to change a value of a method using another function.
Example
Can I change the x to another value using a new method?Code:int myclass::somefunc() { int x =10; return x; }
If yes, how can i do it?
Thanks
x is a local variable to that function. It does not exist in any other function, therefore its value cannot be changed in any other function.
If you give us an overview of what you are trying to accomplish, maybe we can help you with another way of doing it.