problem with boolean flags

Z

zilleeizad

i am using a couple of bool flags to determine certain conditions. these
flags are private members of a class. inside a method, i reset both the
flags before i go into an if-else where if the condition is true, i set
flag1, else i set flag2. my problem is that the flag2 gets set along with
flag1 without my doing so. flag2 is defined after flag1 in the class. if i
swap the definition sequence, the behaviour switches as well. any ideas?
 
J

Jack Klein

i am using a couple of bool flags to determine certain conditions. these
flags are private members of a class. inside a method, i reset both the
flags before i go into an if-else where if the condition is true, i set
flag1, else i set flag2. my problem is that the flag2 gets set along with
flag1 without my doing so. flag2 is defined after flag1 in the class. if i
swap the definition sequence, the behaviour switches as well. any ideas?

My crystal ball is in the shop tonight. POST SOME CODE. Cut it town
to the smallest possible snipped that compiles and copy the text from
your editor right into the body of your message.

We need the class definition, the code that creates an object of the
class, and code that modifies the flags of the class and shows the
problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
ScottChare

Latest Threads

Top