data types

Nov 25, 2012 at 6:02am
int month = 9, day = 7;
int month = 09, day = 07;

are they the same?

Does putting a zero in front mean it is octal instead of decimal number?
Nov 25, 2012 at 6:06am
also,

L'a' and L"a"

are those the same?

putting L in front of a character literal turns it into type wchar_t. does it apply to string literals too?
Nov 25, 2012 at 6:36am
When I did this ;
1
2
int j = 9;
	int i = 09;


I got this
1>c:\users\jordan\documents\visual studio 2010\projects\hold\hold\hold.cpp(10): error C2041: illegal digit '9' for base '8'

Nov 25, 2012 at 6:40am
Does putting a zero in front mean it is octal instead of decimal number?

Yes, it does. Did you try to compile you code? Because it should give you an error on int month = 09:
error: invalid digit "9" in octal constant|

Last edited on Nov 25, 2012 at 6:40am
Topic archived. No new replies allowed.