Filename and line information
Da cppreference.com.
< cpp | preprocessor
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Include altro file di origine in file di origine corrente alla riga immediatamente dopo la direttiva.
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.
Indice |
[modifica]Sintassi
#line lineno | (1) | ||||||||
#line lineno" filename" | (2) | ||||||||
[modifica]Spiegazione
Modifica il numero di riga corrente del preprocessore per lineno. Espansione del __LINE__ macro oltre questo punto si espanderà per lineno più il numero di righe di codice sorgente effettivi rilevati dal momento.
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.
Cambia anche il nome del file corrente preprocessore filename. Espansioni della macro __FILE__ da questo punto produrrà 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.
Qualsiasi gettoni di pre-elaborazione (macro costanti o espressioni) sono ammessi come argomenti a
#line
purché si espandono per un intero decimale valida scelta a seguito di una stringa di caratteri validi.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.
[modifica]Note
Questa direttiva è utilizzato da alcuni strumenti automatici di generazione di codice che producono C + file di origine + da un file scritto in un'altra lingua. In tal caso, le direttive
#line
può essere inserito nel generato C + + numeri di riga file di riferimento e il nome del file originale (umano-modificabile) file sorgente.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.
[modifica]Esempio
#include <cassert>#define FNAME "test.cc"int main(){#line 777 FNAMEassert(2+2==5);}
Output:
test: test.cc:777: int main(): Assertion `2+2 == 5' failed.