print % in c

Peter da Silva peter at ficc.ferranti.com
Tue Feb 26 09:22:34 AEST 1991


In article <1991Feb25.180600.5004 at ux1.cso.uiuc.edu> gordon at osiris.cso.uiuc.edu (John Gordon) writes:
> 	To print special characters with printf(), precede the character
> with a \ character.  Example:

Backslash works on stuff interpreted by the compiler. % isn't one of them.

> 	printf("This a percent sign: \%\n");
No:	printf("This is a percent sign: %%\n");
-- 
Peter da Silva.  `-_-'  peter at ferranti.com
+1 713 274 5180.  'U`  "Have you hugged your wolf today?"



More information about the Comp.lang.c mailing list