confusing C question
Can anyone explain me why, i is considered as an octal number in this code?
#include
int main() {
int i = 0100;
printf("%d",i);
}
#include
int main() {
int i = 0100;
printf("%d",i);
}
Replies
-
Jeffrey ArulrajSimple
The first letter '0' indicate the compiler that the number is an OCTAL number
'0x' indicates Hexa decimal number -
Vishal Sharma
and 0b for binary... Its same like MCU's 😛 didn't think in that way! thanks!Jeffrey SamuelSimple
The first letter '0' indicate the compiler that the number is an OCTAL number
'0x' indicates Hexa decimal number -
Jeffrey Arulraj
It seems '0b' will do that for you mateVishal0203and 0b for binary... Its same like MCU's 😛 didn't think in that way! thanks!
You are reading an archived discussion.
Related Posts
Is there any way to connect RPi & Arduino over serial GPIO without using Dual-Logic Level converter (5.0V <-> 3.3V) ?
If there's any then kindly teach me the method....
Hello
I have three Led's with forward drop of 1.7 V and 10
milliamp current. I am using 9 V battery with 15 miliamp. I used this
website that gave...
Hi CEans, I want to know whether there is any camera out there which has the power or capacity of eye. What is the maximum megapixel of camera available in...
I used Galaxy s4 How it works about Eye Gesture, Finger Gesture technology. Can you Explain me how it works Thanks...
where to create @crazyengineers.net mail id?