For some reason, I can't remember how to printf a %. If I use something like
I just get nonsense. I'm just picking c back up, so some things are forgotten :SCode:printf("20\%");
Any help appreciated![]()
For some reason, I can't remember how to printf a %. If I use something like
I just get nonsense. I'm just picking c back up, so some things are forgotten :SCode:printf("20\%");
Any help appreciated![]()
Use %% to get one %
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Many thanks.
to print one %, use two.
Code:printf("%%");
In general it is safer to use:
Code:printf("%s", "<whatever you like goes here as none of this gets touched %s%f%d%.4u%%>");
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"