PDA

View Full Version : [SOLVED] In C, are %i and %d the same thing?



jessiebrownjr
October 13th, 2009, 11:57 PM
Title says my question.. I'm reading C for dummies, and he pulled a switch on me. I made a sample program to find out the limitations of what I can put in %d/%i and it does "seem" to be the same, but is it?

Try googling C + %i lol, I tried, failed hardcore... He didn't document anything about %i he just started using it in the book, help? :-)

NovaAesa
October 13th, 2009, 11:59 PM
Do you mean % as in modulo or the % used in format strings?

jessiebrownjr
October 14th, 2009, 12:02 AM
Do you mean % as in modulo or the % used in format strings?



#include <stdio.h>
int main()
{
printf("Rawr %d.\n",55)
return (0);
}

sloggerkhan
October 14th, 2009, 12:03 AM
http://www.cplusplus.com/reference/clibrary/cstdio/fprintf/
Based on above link, %i and %d are the same.

jessiebrownjr
October 14th, 2009, 12:24 AM
Appreciate it, this dude that wrote this version of C for dummies is a twit.. terrible sense of humor and sloppy code.. even I can tell its sloppy! lol