473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

bool flag

C++ question: I've initialized some data elements in the int main function. the fourth element is a bool flag (set to false = 0). When I call a class function and that function tries to change the flag to true it doesn't work.

---
int main()
Calculate OB1 (4,25,25,0)
...

Class member function...
...
if (flag=0)
{
....
{
else
...

My constructor is:
void set (int avg=0, int high=0, int low=0, bool f=0);

Do you know why my flag isn't being triggered if the user is inputting 1 for True ?

Thanks for your help. 1267
Aug 21 '06 #1
3 5931
D_C
293 100+
if (flag=0)
That is setting flag to false again. if(flag==0) is how to test whether flag is false. You need to add another equals sign in there.
Aug 21 '06 #2
I tried that too and it doesn't work.
Aug 21 '06 #3
D_C
293 100+
Post the entire code and collectively we will figure out what's wrong with it.
Aug 22 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: gpg | last post by:
I am using a legacy DLL and need to marshal some structures for use in the DLL. For the most part, I have figured out my needs except for one small item. I have a structure that contain, among...
64
by: shaanxxx | last post by:
I have code which says #define MYBOOL int This code is very old. people who have written is not avaible. I was thinking what could be reason. 1) bool datatype was not available that time (10...
7
by: raylopez99 | last post by:
I find that I am using bool variables a lot when I code in Forms. I know how to overload event handlers, and that's great for offloading code from the 'base' event handler and/or creating helper...
1
by: shapper | last post by:
Hello, I have the following Linq query: (from t in database.Tags where t.Name.ToLower == tag select t) I want to define a variable, named Found, that is true if any record is found or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.