MISRA Discussion Forums

Full Version: Relational operators and plain chars and wchar_t
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 '
The use of "" is permitted. For example:

Code:
if ( ( x < '0' ) || ( x > '9' ) )
{
   /* Not a digit */
}