print % in c

Dean Cookson dean at usenet.INS.CWRU.Edu
Thu Feb 28 15:24:09 AEST 1991


In article <4843 at goanna.cs.rmit.oz.au> ok at 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 at 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	      |



More information about the Comp.lang.c mailing list