Where to find code for interpreting c escape sequences?
Georg-Johann Lay
avr@gjlay.de
Fri Aug 26 23:00:00 GMT 2011
Lkjnlkjn Lkjnlkjn schrieb:
> They'll be passed as args to program and I'd like to be able to interpret them as such. I think that gcc source files may have this code, but I don't know where exactly, therefore I'd appreciate a link.
>
> E. g.: program \t
> I'd like to convert "\t" to 0x09. And to do the same for all c escape sequences.
You can simply write
int tab = '\t';
in you program and tab will be set to 9.
As far as GCC is concerned, you might find the definition of ESCAPES in
./gcc/config/elfos.h
helpful.
More information about the Gcc-help
mailing list