small bool problem

S

Srdja123

http://paste.cplusplus.se/paste.php?id=7482

When I try to compile the source I get:

warning C4804: '<=' : unsafe use of type 'bool' in operation

in Visual Express. I'm a newbie when it comes to programming and I'm
not even sure what exactly "bool" does, it's a type if I understand it
correctly.

All help is appreciated! Thx!
 
B

Barry

http://paste.cplusplus.se/paste.php?id=7482

When I try to compile the source I get:

warning C4804: '<=' : unsafe use of type 'bool' in operation

in Visual Express. I'm a newbie when it comes to programming and I'm
not even sure what exactly "bool" does, it's a type if I understand it
correctly.

All help is appreciated! Thx!

else if (19 <= bmi <= 25)

19 <= bmi && bmi <= 25

{
cout << "You have the ideal weight";
}

else if (26 <= bmi <= 30)
26 <= bmi && bmi <= 30

{
cout << "You are overweight!";
}
 
S

Srdja123

else if (19 <= bmi <= 25)

19 <= bmi && bmi <= 25

{
cout << "You have the ideal weight";
}

else if (26 <= bmi <= 30)
26 <= bmi && bmi <= 30

{
cout << "You are overweight!";
}

Thank you Barry! :>
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top