public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Where to find code for interpreting c escape sequences?
       [not found] ` <1314349157.52372.YahooMailNeo@web114715.mail.gq1.yahoo.com>
@ 2011-08-26 22:27   ` Lkjnlkjn Lkjnlkjn
  2011-08-26 23:00     ` Georg-Johann Lay
  0 siblings, 1 reply; 2+ messages in thread
From: Lkjnlkjn Lkjnlkjn @ 2011-08-26 22:27 UTC (permalink / raw)
  To: gcc-help

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. 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Where to find code for interpreting c escape sequences?
  2011-08-26 22:27   ` Where to find code for interpreting c escape sequences? Lkjnlkjn Lkjnlkjn
@ 2011-08-26 23:00     ` Georg-Johann Lay
  0 siblings, 0 replies; 2+ messages in thread
From: Georg-Johann Lay @ 2011-08-26 23:00 UTC (permalink / raw)
  To: Lkjnlkjn Lkjnlkjn; +Cc: gcc-help

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-26 23:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1314307939.94568.YahooMailNeo@web114712.mail.gq1.yahoo.com>
     [not found] ` <1314349157.52372.YahooMailNeo@web114715.mail.gq1.yahoo.com>
2011-08-26 22:27   ` Where to find code for interpreting c escape sequences? Lkjnlkjn Lkjnlkjn
2011-08-26 23:00     ` Georg-Johann Lay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).