Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
query!!
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
agsupriya86
New Member
Join Date:
Mar 2007
Posts:
34
#1
query!!
Jul 12 '07, 09:37 PM
Hello,
Can anybody explain me the difference between 0123 and 123 in C??
I read somewhere its saying 40..how???
scruggsy
New Member
Join Date:
Mar 2007
Posts:
147
#2
Jul 12 '07, 11:01 PM
Originally posted by
agsupriya86
Hello,
Can anybody explain me the difference between 0123 and 123 in C??
I read somewhere its saying 40..how???
If you add a leading 0 to an integer, the compiler reads it in octal (base-8) notation.
Code:
int dec = 10; // dec = 10 in decimal int oct = 010; // oct = 8 in decimal
But 123 in octal is not 40.
Hope this helps.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment