Expand #includes to a text file for C++
问题 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