Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Language%20in%20C%20Interview%20Questions%20and%20Answers

Question: Why the output of sizeof ( 'a' ) is 2 and not 1 ?
Answer: Character constants in C are of type int, hence sizeof ( 'a' ) is equivalent to sizeof ( int ), i.e. 2. Hence the output comes out to be 2 bytes.
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook