Espaços nominais
Variantes
Acções

Comments

Da cppreference.com
< cpp

 
 
Linguagem C++
Tópicos gerais
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.
Controle de fluxo
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.
Declarações execução condicional
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.
Instruções de iteração
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 declarações
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.
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declaração da função
lambda declaração da função
modelo de função
linha especificador
especificações de exceção (obsoleta)
noexcept especificador (C++11)
Exceções
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Namespaces
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)
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
armazenamento duração especificadores
constexpr especificador (C++11)
auto especificador (C++11)
alignas especificador (C++11)
Inicialização
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Literais
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Expressões
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
representações alternativas
Utilitários
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
tipo de alias declaração (C++11)
atributos (C++11)
Conversões
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
conversões implícitas
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
Elenco C-estilo e funcional
Alocação de memória
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.
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Classe propriedades específicas de função
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.
Funções membro especiais
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.
Modelos
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
modelo de classe
modelo de função
especialização de modelo
pacotes de parâmetros (C++11)
Diversos
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Assembly embutido
 
Comentários servir como uma espécie de código de documentação. Quando inserido num programa, que estão efectivamente ignorado pelo compilador, que são exclusivamente destinados a ser utilizados como notas pelos seres humanos que lêem o código fonte. Embora a documentação específica não é parte do padrão C + +, existem várias utilidades que os comentários de análise com diferentes formatos de documentação.
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.

Índice

[editar] Sintaxe

/* comment */ (1)
// comment\n (2)
1)
Muitas vezes conhecido como "estilo C" ou "multi-linha", 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)
Muitas vezes conhecido como "estilo C + +" ou "linha única", 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

Estilo C observações são normalmente utilizados para comentar grandes blocos de texto, no entanto, eles podem ser usados ​​para comentar linhas únicas. Para inserir um comentário no estilo C, simplesmente cercar o texto com /* e */; isso fará com que o conteúdo do comentário a ser ignorado pelo compilador. Embora não seja parte do padrão C + +, e /** */ são muitas vezes usados ​​para indicar blocos de documentação, o que é legal porque o asterisco segunda é simplesmente tratado como parte do comentário. C estilo de comentários não podem ser aninhadas.
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.
Estilo C observações são muitas vezes preferidos em ambientes em que C e C + + código pode ser misturado, porque são a única forma de comentário, que pode ser usada no padrão 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 comentários são geralmente usados ​​para comentar linhas simples, no entanto, vários C + + estilo comentários podem ser colocados juntos para formar multi-line comentários. C + + estilo de comentários ao compilador para ignorar todo o conteúdo entre // e uma nova linha, o que os torna muito útil.
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] Exemplo

/* 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;
}