簡體   English   中英

C ++中'和','或'等關鍵字的目的是什么?

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

以下關鍵字的目的是什么?

and      bitand   compl   not_eq   or_eq   xor_eq
and_eq   bitor    not     or       xor

如果他們只是直接相當於:

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

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

iso646.h” ......定義了許多宏允許程序員使用C語言位運算符和邏輯運算符,其中,無頭文件,不能對一些國際和非QWERTY鍵盤很快或很容易輸入的。

文件名是指ISO646標准,這是一個7位字符集,帶有許多區域變體,其中一些具有重音字符代替C運算符使用的標點符號。“

這樣你就可以編寫瘋狂的代碼詩:

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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM