PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.cplus > small bool problem
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
small bool problem

Réponse
 
LinkBack Outils de la discussion
Vieux 17/01/2008, 04h53   #1
Srdja123@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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 is appreciated! Thx!
  Réponse avec citation
Vieux 17/01/2008, 04h57   #2
Barry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: small bool problem

Srdja123@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 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
  Réponse avec citation
Vieux 17/01/2008, 05h12   #3
Srdja123@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: small bool problem

On 17 Jan, 05:57, Barry <dhb2...@gmail.com> wrote:
> 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 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! :>
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h41.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07759 seconds with 11 queries