Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Relational operators and plain chars and wchar_t
#1
The documentation for MISRA C++ rule #4-5-3 includes the following:
Quote:The relational operators = may be used to determine if a character (or wide character) represents a digit.
The document then includes several examples which demonstrate compliance (or lack thereof) for the '>=' and '
Reply
#2
The use of "" is permitted. For example:

Code:
if ( ( x < '0' ) || ( x > '9' ) )
{
   /* Not a digit */
}
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)