468,512 Members | 1,348 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

small bool problem

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!
Jan 17 '08 #1
2 5758
Sr******@gmail.com wrote:
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!";
}
--
Thanks
Barry
Jan 17 '08 #2
On 17 Jan, 05:57, Barry <dhb2...@gmail.comwrote:
Srdja...@gmail.com wrote:
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!";
}

--
Thanks
Barry
Thank you Barry! :>
Jan 17 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by mihai | last post: by
5 posts views Thread by Huffin the Puffin | last post: by
3 posts views Thread by Leslie A Rhorer | last post: by
5 posts views Thread by aeldaly | last post: by
9 posts views Thread by anonymous | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.