Can cpp generate a line starting with hash?

47 views Asked by At

This c-preprocessor (cpp) input:

#define hash #
#define not_hash x
hash
not_hash

produces the following output when run through cpp -P:

 #
x

Is there any input to cpp capable of outputting a line that starts with hash as the first character?

1

There are 1 answers

0
smeg On

n. m. could be an AI answered the question correctly: "If by CPP you mean a specific standalone implementation of the C preprocessor that gcc used to use a long time ago, then yes, use -traditional-cpp flag. If you mean a Platonic idea of the C preprocessor, then the question makes no sense, because at the abstract level the C preprocessor doesn't produce lines at all, it produces a stream of tokens."