Greg Lopp on Mon, 15 Sep 2003 15:08:04 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] C Question (Off Topic?)


printf("%%");

or 

printf("\x25");



On Mon, Sep 15, 2003 at 02:58:40PM -0400, Christopher Shanahan wrote:
> Hello all,
> 
> I'm a beginner trying to learn C and I have a question. I realize this isn't a
> C mailing list, however, I know there are a lot of programmers on this list
> and I'd rather post here than somewhere else. I hope you don't mind.
> 
> I want to use the % symbol as part of a string literal within a printf()
> statement. The % symbol is used as a conversion specifier, such as %d,
> indicating a decimal integer. I understand this. What I can't seem to find--in
> my many books--is how to use the % symbol as part of a string.
>     printf("Congratulations. You saved 20%.\n");
> 
> Any suggestions?  TIA
> 
> Chris Shanahan
> 
> _________________________________________________________________________
> Philadelphia Linux Users Group        --       http://www.phillylinux.org
> Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug
_________________________________________________________________________
Philadelphia Linux Users Group        --       http://www.phillylinux.org
Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug