boolean expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oi123
    New Member
    • Apr 2007
    • 10

    boolean expression

    for the boolean expression
    bool validNumber(int value)
    {
    return (1 < value) and (value < 100);
    }
    why does the boolean function give me an error message about missing ; before idenitfy 'and'
  • svlsr2000
    Recognized Expert New Member
    • Feb 2007
    • 181

    #2
    there is no identifier "and" in c++.

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      Originally posted by oi123
      for the boolean expression
      bool validNumber(int value)
      {
      return (1 < value) and (value < 100);
      }
      why does the boolean function give me an error message about missing ; before idenitfy 'and'
      The logicl boolean AND operator in C is &&.

      This will return true for values in the range 2 - 99 inclusive. Is that what you wanted?

      Comment

      Working...