Filename and line information
De 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. |
Incluye el archivo fuente en un archivo fuente actual en la línea inmediatamente después de la directiva .
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.
Contenido |
[editar] Sintaxis
#line lineno
|
(1) | ||||||||
#line lineno " filename"
|
(2) | ||||||||
[editar] Explicación
Cambia el número de línea actual preprocesador a lineno. Expansiones del __LINE__ macro más allá de este punto se ampliará para lineno más el número de líneas de código fuente reales encontrados 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.
También cambia el nombre de archivo actual preprocesador para filename. expansiones de la macro __FILE__ desde este punto producirá 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.
Cualquier tokens preprocesamiento (constantes o expresiones de macro) están permitidos como argumentos a
#line
, siempre y cuando se expanden a un entero decimal opcionalmente válido después de una serie de caracteres válida .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 se usa por algunas herramientas de código de generación automática que producen archivos C + fuente + de un archivo escrito en otro idioma. En ese caso, las directivas
#line
se puede insertar en la generada en C + + archivos hacen referencia a los números de línea y el nombre de archivo de la original (el hombre editable) el fichero fuente.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] Ejemplo
#include <cassert> #define FNAME "test.cc" int main() { #line 777 FNAME assert(2+2 == 5); }
Output:
test: test.cc:777: int main(): Assertion `2+2 == 5' failed.