Pages
Home
VijayNetwork
C Programming Q&A
Saturday, January 14, 2012
Why is sizeof('a') not 1?
Character constants in C are of type int, so sizeof('a') is sizeof(int) (though it's different in C++).
Result:
In Turbo C output is: 2
In Turbo C++ output is: 1
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment