Is it possible to expand out #include
lines of a c++ file, probably using the C preprocessor, such that I can read an extended file without #includes
, but instead with the files that are #include
d?
To be concrete, if I have
fileA.cpp:
#include "fileB.H"
int main()
{
//do whatever
return(0);
}
fileB.H:
#include "fileC.H"
//Some lines of code
fileC.H
//Some other lines of code
And output:
//Some other lines of code
//Some lines of code
int main()
{
//do whatever
return(0);
}
Essentially, copy-pasting the files that are included into one large text/C++ code file, without compiling?
If I run the cpp with relevant -I<Directory containing files to include>
then I get a long text file, but rather than just code, it gives what would be passed to the compiler (duh!)