Stephen Kairys
asked on
Is there such a thing as an %i format specifier in C?
Hello.
Someone E-mailed me some information about C format specifiers, and in it, referreed to the
%hd and %hi format specifiers (the "h" specifing a short 16-bit int).
%hd makes sense to me as a "cousin" of %d, but "%hi" does not, since I'm not sure that there
is such a thing as %i. %hu (for unsigned) would seem more logical. I've programmed in C for
about four years and have always used %d and %u.
Please advise.
Thanks
stevefromc
Someone E-mailed me some information about C format specifiers, and in it, referreed to the
%hd and %hi format specifiers (the "h" specifing a short 16-bit int).
%hd makes sense to me as a "cousin" of %d, but "%hi" does not, since I'm not sure that there
is such a thing as %i. %hu (for unsigned) would seem more logical. I've programmed in C for
about four years and have always used %d and %u.
Please advise.
Thanks
stevefromc
I use to use %i specifier most of the time, it refers to a unsigned integer, and yes, it is a standard C specifier.
ASKER
Is it the same as %u? If not, what is the difference? Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cool. That clarifies it. Thanks so much :)
ASKER
One more thing: I split your points since your last two posts both contained helpful info. Thanks again!
If both answers are totally clear, why the B grade?
B grade is suggested for semi-satisfactory answers.
I think I have fully answered your question, including theory links.
B grade is suggested for semi-satisfactory answers.
I think I have fully answered your question, including theory links.
ASKER
Valid point. Guess I wasn't thinking. I'll post on Community Support for a grade change.
Thank you man, I preciate it. See you in next question.
Jaime.
Jaime.
The grade has been changed to A as requested.
RomMod
Community Support Moderator
RomMod
Community Support Moderator