This is the only place I've ever seen and
, or
and not
listed as actual operators in C++. When I wrote up a test program in NetBeans, I got the red underlining as if there was a syntax error and figured the website was wrong, but it is NetBeans which is wrong because it compiled and ran as expected.
I can see !
being favored over not
but the readability of and
&& or
seems greater than their grammatical brothers. Why do these versions of the logical operators exist and why does seemingly no one use it? Is this truly valid C++ or some sort of compatibility with C that was included with the language?
||
and&&
, maybe even!
at times. Words are always better then "line noise", not to mention the possible confusion with the bit manipulation operators. – Ichthyoand
is more readable and then writing "and
&&or
" though :) – Ivan Vergilievbegin
,end
,contains
,pointer
,allocatable
,extends
, etc. I'd run fast in the opposite direction if someone offered me to work with Fortran again, but, hey, maybe that's a task for you? ;-) Honestly, the use of symbols for vital stuff in C/C++/Java is a feature, not a bug. It allows your eyes to quickly recognize a single symbol instead of parsing and interpreting a word instead. – cmaster - reinstate monica