Espacios de nombres
Variantes
Acciones

Comments

De cppreference.com
< cpp

 
 
Lenguaje C++
Los temas generales
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Control de flujo
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Sentencias condicionales ejecución
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Instrucciones de iteración
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ir declaraciones
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funciones
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declaración de la función
lambda declaración de la función
función de plantilla
especificador inline
especificaciones de excepción (obsoleto)
noexcept especificador (C++11)
Excepciones
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los espacios de nombres
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
decltype specifier (C++11)
Los especificadores
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cv especificadores
almacenamiento duración especificadores
constexpr especificador (C++11)
auto especificador (C++11)
alignas especificador (C++11)
Inicialización
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los literales
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Expresiones
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
representaciones alternativas
Utilidades
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
alias de tipo de declaración (C++11)
atributos (C++11)
Lanza
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
conversiones implícitas
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
C-cast estilo y funcional
De asignación de memoria
Original:
Memory allocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Clases
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Clase propiedades específicas de la función
Original:
Class-specific function properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funciones especiales miembro
Original:
Special member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Plantillas
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
clase de plantilla
función de plantilla
plantilla de especialización
paquetes de parámetros (C++11)
Varios
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Montaje en línea
 
Comentarios servir como una especie de documentación en el código. Cuando se inserta en un programa, están efectivamente ignorados por el compilador; ellos están únicamente destinados a ser utilizados como notas de los seres humanos que leen el código fuente. Aunque la documentación específica que no es parte del estándar C + +, existen varias utilidades que los comentarios analizan con diferentes formatos de documentación .
Original:
Comments serve as a sort of in-code documentation. When inserted into a program, they are effectively ignored by the compiler; they are solely intended to be used as notes by the humans that read source code. Although specific documentation is not part of the C++ standard, several utilities exist that parse comments with different documentation formats.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar] Sintaxis

/* comment */ (1)
// comment\n (2)
1)
A menudo conocido como "C-estilo" o "multi-línea", comenta .
Original:
Often known as "C-style" or "multi-line" comments.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
A menudo conocido como "C + +-estilo" o "una sola línea", comenta .
Original:
Often known as "C++-style" or "single-line" comments.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] C-estilo

C-comentarios tipo se utilizan generalmente para comentar grandes bloques de texto, sin embargo, que se puede utilizar para comentar líneas simples. Para insertar un comentario de C-estilo, simplemente rodear el texto con /* y */, lo que hará que el contenido del comentario que serán ignorados por el compilador. Aunque no es parte del estándar C + +, y /** */ se utilizan a menudo para indicar los bloques de documentación, lo que es legal porque el segundo asterisco simplemente se trata como parte del comentario. C-estilo de comentarios no pueden anidarse .
Original:
C-style comments are usually used to comment large blocks of text, however, they can be used to comment single lines. To insert a C-style comment, simply surround text with /* and */; this will cause the contents of the comment to be ignored by the compiler. Although it is not part of the C++ standard, /** and */ are often used to indicate documentation blocks; this is legal because the second asterisk is simply treated as part of the comment. C-style comments cannot be nested.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
C comentarios del estilo se prefieren a menudo en entornos en los que C y C + + se pueden mezclar, porque son la única forma de comentario que puede ser utilizado en el estándar de C (antes de C99) .
Original:
C-style comments are often preferred in environments where C and C++ code may be mixed, because they are the only form of comment that can be used in the C standard (prior to C99).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] C + +-estilo

C-estilo de los comentarios se utiliza generalmente para hacer comentarios líneas simples, sin embargo, varios C + +-estilo comentarios pueden colocarse juntos para formar multilínea comentarios. C + + comentarios del estilo indicar al compilador que ignore todos los contenidos entre // y una nueva línea, lo que los hace muy útiles .
Original:
C-style comments are usually used to to comment single lines, however, multiple C++-style comments can be placed together to form multi-line comments. C++-style comments tell the compiler to ignore all content between // and a new line, which makes them very useful.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

/* C-style comments can contain
multiple lines */
/* or just one */
 
// C++-style comments can comment one line
 
// or, they can
// be strung together
 
int main()
{
  // The below code won't be run
  // return 1;
 
  // The below code will be run
  return 0;
}