Alternative operator representations
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
C + + (y C) el código fuente puede estar escrito en cualquier conjunto de caracteres no ASCII de 7 bits que incluye el conjunto de caracteres ISO 646/ECMA-6 invariante. Sin embargo, varios operadores de C + + y puntuadores requieren caracteres que se encuentran fuera del juego de códigos ISO 646:
{, }, [, ], #, \, ^, |, ~. Para ser capaz de utilizar la codificación de caracteres donde algunos o todos de estos símbolos no existen, C + + define dos tipos de alternativas: palabras clave adicionales que corresponden a los operadores que utilizan estos caracteres y combinaciones especiales de dos o tres ISO 646 caracteres compatibles que son interpretados como si se tratara de un simple no-ISO 646 caracteres .Original:
C++ (and C) source code may be written in any non-ASCII 7-bit character set that includes the ISO 646/ECMA-6 invariant character set. However, several C++ operators and punctuators require characters that are outside of the ISO 646 codeset:
{, }, [, ], #, \, ^, |, ~. To be able to use character encodings where some or all of these symbols do not exist, C++ defines two kinds of alternatives: additional keywords that correspond to the operators that use these characters and special combinations of two or three ISO 646 compatible characters that are interpreted as if they were a single non-ISO 646 character.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Contenido |
[editar] Palabras clave alternativa
Hay palabras alternativas para varios operadores definidos como palabras clave en el C + + estándar .
Original:
There are alternative spellings for several operators defined as keywords in the C++ standard.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
| Primary | Alternative |
|---|---|
&&
|
and
|
&=
|
and_eq
|
&
|
bitand
|
|
|
bitor
|
~
|
compl
|
!
|
not
|
!=
|
not_eq
|
| || | or |
|=
|
or_eq
|
^
|
xor
|
^=
|
xor_eq
|
[editar] Compatibilidad con C
Las mismas palabras se definen en el lenguaje de programación C en el archivo de inclusión <iso646.h> como macros. Debido a que en C + + son palabras clave del lenguaje, la versión C + + de <iso646.h>, así como <ciso646>, no define nada .
Original:
The same words are defined in the C programming language in the include file <iso646.h> as macros. Because in C++ these are language keywords, the C++ version of <iso646.h>, as well as <ciso646>, does not define anything.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar] Dígrafos y trigrafos
Las siguientes combinaciones de dos y tres caracteres (dígrafos y trigrafos) son sustituciones válidas para sus respectivos personajes principales:
Original:
The following combinations of two and three characters (digraphs and trigraphs) are valid substitutions for their respective primary characters:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
| Primary | Digraph | Trigraph |
|---|---|---|
{ |
<% |
??<
|
None} |
%> |
??>
|
[ |
<: |
??(
|
] |
:> |
??)
|
# |
%: |
??=
|
\ |
??/
| |
^ |
??'
| |
| |
??!
| |
~ |
??-
|
[editar] Palabras clave
and, and_eq, bitand, bitor, compl, not, not_eq, or, or_eq, xor, xor_eq
[editar] Ejemplo
El siguiente ejemplo muestra el uso de palabras clave alternativas diversas:
Original:
The following example demonstrates the use of several alternative keywords:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
%:include <iostream> int main(int argc, char *argv<::>) <% if (argc > 1 and argv<:1:> not_eq '\0') <% std::cout << "Hello " << argv<:1:> << '\n'; %> %>