Filename and line information
Da cppreference.com
< cpp | preprocessor
![]() | 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. |
Inclui arquivo de outra fonte em arquivo de fonte de corrente na linha imediatamente após a diretiva.
Original:
Includes other source file into current source file at the line immediately after the directive .
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.
Índice |
[editar]Sintaxe
#line lineno | (1) | ||||||||
#line lineno" filename" | (2) | ||||||||
[editar]Explicação
Altera o número da linha atual de pré-processamento para lineno. expansões do __LINE__ macro além deste ponto vai se expandir para lineno mais o número de linhas de código fonte reais encontradas desde.
2) Original:
Changes the current preprocessor line number to lineno. Expansions of the macro __LINE__ beyond this point will expand to lineno plus the number of actual source code lines encountered since.
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.
Também altera o nome do arquivo atual pré-processador para filename. Expansões da macro __FILE__ a partir deste ponto vai produzir filename.
Original:
Also changes the current preprocessor file name to filename. Expansions of the macro __FILE__ from this point will produce filename.
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.
Qualquer fichas de pré-processamento (constantes macro ou expressões) são permitidos como argumentos para
#line
, desde que se expandir para um decimal inteiro válido, opcionalmente, após uma seqüência de caracteres válido.Original:
Any preprocessing tokens (macro constants or expressions) are permitted as arguments to
#line
as long as they expand to a valid decimal integer optionally following a valid character string.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]Notas
Esta directiva é usada por algumas ferramentas de código automáticas geração que produzem C + arquivos de origem + a partir de um arquivo escrito em outro idioma. Nesse caso, as directivas
#line
pode ser inserido no gerado arquivo C + + números de linha referência eo nome do arquivo (humano-editável) fonte original.Original:
This directive is used by some automatic code generation tools which produce C++ source files from a file written in another language. In that case,
#line
directives may be inserted in the generated C++ file referencing line numbers and the file name of the original (human-editable) source file.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]Exemplo
#include <cassert>#define FNAME "test.cc"int main(){#line 777 FNAMEassert(2+2==5);}
Saída:
test: test.cc:777: int main(): Assertion `2+2 == 5' failed.