Concept
What do character comparison results show in C?
ComputerScienceOne / If, If-Else, If-Else-If Statements
"16. Conditionals Comparison Example Result ('A' < 'a') true ('A' == 'a') false ('A' < 'Z') true ('0' < '9') true ('\n\n' < 'A') true (' ' < '\n\n') false Table 16.4.: Character comparisons in C. Understand that you can write this code, it will compile, and it will even run. However, the results will not be as expected."
Related Ideas
- How can comparison operators be used with characters in C?ComputerScienceOne · Comparing Strings and Characters
- How are comparison operators used with characters in C?ComputerScienceOne · Order of Precedence
- Why can’t numeric comparison operators be used to compare strings in C?ComputerScienceOne · Comparing Strings and Characters
- What primitive types does C support?ComputerScienceOne · Declaration & Assignment
- Why can numeric comparison operators not be used to compare strings in C?ComputerScienceOne · Order of Precedence
- Why can’t numerical comparison operators be used to compare strings in C?ComputerScienceOne · Comparisons
- How does strcmp() compare the contents of two strings in C?ComputerScienceOne · Comparisons
- What is the order of precedence and associativity of common C operators?ComputerScienceOne · Comparing Strings and Characters