Filename and line information – cppreference.com
Aus cppreference.com
<metanoindex/>
Inklusive anderen Quelldatei in aktuellen Quelldatei an der Linie sofort nach der Richtlinie .
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.
Syntax
#line lineno
|
(1) | ||||||||
#line lineno "filename"
|
(2) | ||||||||
Erklärung
Ändert die aktuelle Präprozessor Zeilennummer lineno. Erweiterungen des Makros __LINE__ über diesen Punkt hinaus wird lineno plus der Anzahl der tatsächlichen Zeilen Quelltext gestoßen, da zu erweitern .
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.
2)
Auch ändert die aktuelle Präprozessor Dateinamen filename. Erweiterungen des Makros __FILE__ von diesem Punkt produziert 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.
Jede Vorverarbeitung Token (Makro-Konstanten oder Ausdrücke) werden als Argumente an #line zulässig, solange sie zu erweitern, um eine gültige Dezimalzahl gegebenenfalls nach eine gültige Zeichenkette .
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.
Notes
Diese Richtlinie wird durch Verwendung einige automatische Codegenerierung Werkzeuge, die C + +-Quellcode-Dateien erzeugen aus einer Datei in einer anderen Sprache geschrieben. In diesem Fall kann #line Richtlinien eingefügt werden die erzeugten C + +-Datei verweisen Zeilennummern und den Dateinamen des ursprünglichen (human-editierbar) Quelldatei.
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.
Beispiel
#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.