Apperantly rumor has it that it is possible to #include a single line in C (possibly with gcc)
e.g.
#include <file.h> 5
To get like line 5. Cannot find anything like that in the cpp docs.
Or which preprocessors allow doing ugly hacks like that?!
I've never heard of such a feature, and I have certainly not come across any preprocessors that would support it.
In any case, it sounds like a really bad idea. What if someone inserted a blank line at the top of file.h
... would you be happy for that change to break your program?
If you control file.h
, I think the best approach is to extract line 5 into a separate header, and #include
it both into file.h
and into your main program.
I don't think that's possible with GCC or any other compiler for that matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With