char & int

Just learned that ‘char’s in C are small integers! This means that ‘char’ variables and constants are identical to ‘int’s in arithmetic expressions.,

Till recently, I thought if x had to store a value ‘a’, then x had to be of the type ‘char’.  Now that is pretty much false. If x should check for EOF values, x should be of type ‘int’ as ‘char’ type will not be able to store EOF in addition to any ‘char’.

Programming as an art, is mastered only by a very few!

Reference: C Programming Language, Brian W. Kernigham & Dennis M. Ritchie


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: