print % in c

Dean Cookson dean at usenet.INS.CWRU.Edu
Tue Feb 26 10:29:00 AEST 1991


In article <31530035 at hpcvia.CV.HP.COM> brianh at hpcvia.CV.HP.COM (brian_helterline) writes:
>Any character following a \ will be taken literally so just preceed
>any "special" char with a \ so:
>
>	printf( "This is a slash \\ and a precent sign \%\n" )
>
>would produce: This is a slash \ and a percent sign %
Ahhh no.

What you want to do is:
printf("%%\n");

Which will print:
%


Is in K&R.

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