Bifalgorithm post · Computer science one · Order of Precedence
Why can numeric comparison operators not be used to compare strings in C?
Why can numeric comparison operators not be used to compare strings in C? (Computer science one · Order of Precedence) — "Numeric comparison operators cannot b…
Ideas in this flowchart
- Numeric comparison operators cannot be used to compare strings in C.
- The expression ("aardvark" < "zebra") can be written as valid C.
- Although valid, the expression's result would not necessarily be true or false.
- The reason is that strings in C are represented as arrays.
- Arrays in C are represented as memory locations.
- These representation issues will be explored in greater depth later.