Unix Programming - question to printf()

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > November 2007 > question to printf()





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author question to printf()
arsenic

2007-11-21, 1:25 pm

this sounds like a verry stupid question but google could not give an
answer..
who can i print '%' with printf() in C ?
It does not work with \% .

thx and regards
Johannes Bauer

2007-11-21, 1:25 pm

arsenic schrieb:
> this sounds like a verry stupid question but google could not give an
> answer..
> who can i print '%' with printf() in C ?
> It does not work with \% .


%%

Greetings,
Johannes

--
"Viele der Theorien der Mathematiker sind falsch und klar
Gotteslästerlich. Ich vermute, dass diese falschen Theorien genau
deshalb so geliebt werden." -- Prophet und Visionär Hans Joss aka
HJP in de.sci.mathematik <4740ad67$0$3811$5402220f@news.sunrise.ch>
Eric Sosman

2007-11-21, 1:25 pm

arsenic wrote On 11/21/07 13:42,:
> this sounds like a verry stupid question but google could not give an
> answer..
> who can i print '%' with printf() in C ?
> It does not work with \% .


printf ("I am 100%c sure this will work.\n", '%');

printf ("... but I am 100%% sure this is better.\n");

--
Eric.Sosman@sun.com
arsenic

2007-11-22, 7:22 pm

i solved the problem.
it only printf the '%' in printf("\% ") if i add an \n else the buffer
does not get flushed....
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com