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. |
Inclut le fichier source autre dans le fichier source de courant sur la ligne immédiatement après la directive .
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.
Sommaire |
[modifier] Syntaxe
#line lineno
|
(1) | ||||||||
#line lineno " filename"
|
(2) | ||||||||
[modifier] Explication
Change le numéro de la ligne courante. préprocesseur à lineno extensions de la __LINE__ macro-delà de ce point sera étendu à lineno plus le nombre de lignes de code source réelles rencontrées depuis .
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.
change également le nom du fichier en cours de préprocesseur filename. Extensions de la macro __FILE__ de ce point va produire 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.
Toute jetons de pré-traitement (macro constantes ou des expressions) sont autorisés comme arguments à
#line
tant qu'ils étendre à un nombre entier décimal valide éventuellement après une chaîne de caractères valide .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.
[modifier] Notes
Cette directive est utilisée par certains outils de génération de code automatique qui produisent des fichiers source C + + à partir d'un fichier écrit dans une autre langue. Dans ce cas, les directives
#line
peut être inséré dans le C + + généré le fichier de référencement des numéros de ligne et le nom du fichier de l'original (d'origine humaine modifiable) du fichier source .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.
[modifier] Exemple
#include <cassert> #define FNAME "test.cc" int main() { #line 777 FNAME assert(2+2 == 5); }
Résultat :
test: test.cc:777: int main(): Assertion `2+2 == 5' failed.