Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uwm.edu!bionet!agate!usenet.ins.cwru.edu!usenet!dean From: dean@usenet.INS.CWRU.Edu (Dean Cookson) Newsgroups: comp.lang.c Subject: Re: print % in c Message-ID: <1991Feb28.042409.14007@usenet.ins.cwru.edu> Date: 28 Feb 91 04:24:09 GMT References: <61516@eerie.acsu.Buffalo.EDU> <4843@goanna.cs.rmit.oz.au> Sender: news@usenet.ins.cwru.edu Reply-To: dean@po.CWRU.Edu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 21 Nntp-Posting-Host: usenet.ins.cwru.edu In article <4843@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: [Stuff Deleted] > So while > a compiler may do anything at all when it comes across \%, > it is most likely to treat it just like %." >There. Will that do? (What's more, I tried it under several compilers >before I posted. Sadly, all were pcc-based.) > Nope, sorry but it won't. You had me up to the "most likely" part. The behavior is undefined. (See section A.2.5.2 Character Constants of the Ref. Manual in K&R 2) What the compiler is most likely to do is something random. (ie your pcc based compilers like it, gcc gives a warning then doesn't print it. Sun cc gives no warning, then doesn't print it) Dean -- | Dean Cookson (Opinions? What opinions??) dean@po.cwru.edu | | Information Network Services DoD #207 AMA #573534 | | Case Western Reserve U. Cleveland, Oh 44106 1981 Honda CB750C | | 216-754-1834 (H) 216-368-2928 (W) 1988 Bianchi Limited |