According to K&R C section 1.6, a char is a type of integer. So why do we need %c. And why can’t we use %d for everything?
According to K&R C section 1.6, a char is a type of integer. So
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because
%dwill print the numeric character code of thechar:prints
97(on an ASCII system), whileprints
a.