Path: utzoo!attcan!uunet!cs.utexas.edu!hellgate.utah.edu!caen!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!mit-eddie!uw-beaver!milton!ogicse!intelhf!ichips!inews!iwarp.intel.com!csun!kithrup!sef From: sef@kithrup.COM (Sean Eric Fagan) Newsgroups: comp.lang.c Subject: Re: print % in c Message-ID: <1991Feb28.081654.20524@kithrup.COM> Date: 28 Feb 91 08:16:54 GMT References: <61516@eerie.acsu.Buffalo.EDU> <31530035@hpcvia.CV.HP.COM> <1991Feb27.020629.24624@dvorak.amd.com> Organization: Kithrup Enterprises, Ltd. Lines: 19 In article <1991Feb27.020629.24624@dvorak.amd.com> tim@amd.com (Tim Olson) writes: >The real answer is that '\' is a special escape character for >character constants and strings in C, and it is processed at >compile/assemble time. It can be used to represent frequently used >values (e.g. \t = tab, \r = return, \n = newline, \\ = \), as well any >character by following the backslash with an octal constant. Heh. Moderately amusing story: a friend of mine had worked extensively on a Small-C compiler, to the point where it was not quite small-C anymore. Anyway, the compiler treated "\%" as "\%", and his version of printf treated that as an escape for '%' (i.e., equivalent to '%%'). He didn't believe me when I told him he was wrong... 8-) -- Sean Eric Fagan | "I made the universe, but please don't blame me for it; sef@kithrup.COM | I had a bellyache at the time." -----------------+ -- The Turtle (Stephen King, _It_) Any opinions expressed are my own, and generally unpopular with others.