简体   繁体   English

C ++中'和','或'等关键字的目的是什么?

[英]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: 如果他们只是直接相当于:

&&       &        ~       !=       |=      ^=
&=       |        !       ||       ^

http://en.wikipedia.org/wiki/Iso646.h 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. iso646.h” ......定义了许多宏允许程序员使用C语言位运算符和逻辑运算符,其中,无头文件,不能对一些国际和非QWERTY键盘很快或很容易输入的。

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." 文件名是指ISO646标准,这是一个7位字符集,带有许多区域变体,其中一些具有重音字符代替C运算符使用的标点符号。“

Its so you can write crazy code poems like: 这样你就可以编写疯狂的代码诗:

class jack
{
   jack();
   jack( jack & jill );
   jack& came_tumbling( int after );
   jack& fell( jack & jill ); 
   jack& operator &= ( jack & jill );
   jack& operator & ( jack & jill );
}

void to_fetch( int pail );

int a_pail;
int after;
jack broke_his_crown;
jack went_up_the_hill;
jack down;

jack and jill = went_up_the_hill;
to_fetch( a_pail ); // of water
jack fell( down and broke_his_crown 
and jill.came_tumbling( after ));

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C++:关键字类 A 有什么作用? B级; class C;等文件开头完成? - C++: What does having keyword class A; class B; class C;, etc. at the beginning of a file accomplish? “modf()”(来自 C/C++ 等的数学 function 等)的简写是什么? - what is “modf()” (a math function from C/C++ etc.) shorthand for? 继承Java集合接口(Set,Map,List等)的C ++等价物是什么? 或者扩展AbstractCollection? - What is the C++ equivalent of inheriting a Java collection interface (Set, Map, List etc.)? Or extending AbstractCollection? 什么是与电子元件(步进电机等)接口的良好编程语言(或一组 C++ 库)? - What would be a good programming language (or a set of libraries for C++) to interface with electronic components (stepper motors etc.)? 什么是具有最简单学习曲线的C ++ GUI构建选项 - VS / Qt / wxWidgets /等? - What's the C++ GUI building option with the easiest learning curve - VS/Qt/wxWidgets/etc.? 在C ++中,哪些类别(左值,右值,右值等)可以生成类类型临时的表达式? - In C++, what categories (lvalue, rvalue, xvalue, etc.) can expressions that produce temporaries of class type fall into? 使用包含%1,%2等的格式字符串,而不是%d,%s等。 - Linux,C ++ - Use format strings that contain %1, %2 etc. instead of %d, %s etc. - Linux, C++ Scala等与C / C ++ / Fortran之间的性能比较? - Comparison of performance between Scala etc. and C/C++/Fortran? 为什么在C / C ++中使用uint_8等? - Why is uint_8 etc. used in C/C++? 在C ++中灌输的目的是什么? - What the purpose of imbue in C++?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM