![]() |
|
#1
|
|||
|
|||
Changing scope of objectI have two classes, call them class1 and class2. In my main(), I declare a new class object:
class2 stepping_action = new class2; stepping_action has a variable called "contained" that is a boolean. What I need to do is change the value of this variable from within class1. When I try, it tells me that stepping_action is not in the right scope. I have tried declaring stepping_action outside of the main but I still get the same error. How can I change this variable from class1? |
|
#2
|
|||
|
|||
Re: Changing scope of objectQuote:
Quote:
In other words: Show Us the Code! Regards, Dave |
|
#3
|
|||
|
|||
Re: Changing scope of objectI fixed the problem.
|
|
#4
|
|||
|
|||
Re: Changing scope of objectNo need of showing code is required....
do the following:-- Make class1 as a friend of class2 !!! (or) Make the function in which you want to change the value of "contained" make that as friend!!! |
Recent GIDBlog
A Week in Kuwait by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| constructors/classes | mapes479 | C++ Forum | 3 | 19-Nov-2006 17:34 |
| Use of HttpWebRequest object | dattaforit | .NET Forum | 1 | 08-Oct-2006 05:29 |
| Please Help Me To Build My Calendar!!! | suriacute85 | Java Forum | 0 | 05-Oct-2006 19:39 |
| Pointer values changing unexpectedly | spudtheimpaler | C Programming Language | 11 | 04-Mar-2004 16:37 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The