Connecting Tech Pros Worldwide Help | Site Map

small bool problem

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 17th, 2008, 03:55 AM
Srdja123@gmail.com
Guest
 
Posts: n/a
Default 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!

  #2  
Old January 17th, 2008, 04:05 AM
Barry
Guest
 
Posts: n/a
Default Re: small bool problem

Srdja123@gmail.com wrote:
Quote:
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
  #3  
Old January 17th, 2008, 04:15 AM
Srdja123@gmail.com
Guest
 
Posts: n/a
Default Re: small bool problem

On 17 Jan, 05:57, Barry <dhb2...@gmail.comwrote:
Quote:
Srdja...@gmail.com wrote:>
Quote:
When I try to compile the source I get:
>
Quote:
warning C4804: '<=' : unsafe use of type 'bool' in operation
>
Quote:
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.
>
Quote:
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! :>
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.