Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of the 'and', 'or', etc. keywords in C++?

What is the purpose of the following keywords?

and      bitand   compl   not_eq   or_eq   xor_eq
and_eq   bitor    not     or       xor

If all they are is a direct equivalent of:

&&       &        ~       !=       |=      ^=
&=       |        !       ||       ^
like image 735
Matt Avatar asked Jun 28 '12 18:06

Matt


People also ask

What is the use of keywords in C?

Keywords are words that have special meaning to the C compiler. In translation phases 7 and 8, an identifier can't have the same spelling and case as a C keyword. For more information, see translation phases in the Preprocessor Reference. For more information on identifiers, see Identifiers.

What are keywords and variables in C?

A variable can have alphabets, digits, and underscore. A variable name can start with the alphabet, and underscore only. It can't start with a digit. No whitespace is allowed within the variable name. A variable name must not be any reserved word or keyword, e.g. int, goto, etc.


1 Answers

http://en.wikipedia.org/wiki/Iso646.h

iso646.h "...defines a number of macros which allow programmers to use C language bitwise and logical operators, which, without the header file, cannot be quickly or easily typed on some international and non-QWERTY keyboards.

The filename refers to the ISO646 standard, a 7-bit character set with a number of regional variations, some of which have accented characters in place of the punctuation marks used by C operators."

like image 139
Kylotan Avatar answered Sep 19 '22 20:09

Kylotan