Not able to understand whats happening in the below code
wchar_t wc;
wc =L'ab';
char ch = 'ab';
When i am debugging the above code , i found that a is stored in wc where as b is stored in ch .
I dont understand why a is not being stored inside the ch.
It’s compiler defined behavior:
On VS2012, I get
'a','b'outputon gcc 4.7.2, I get
'b','b'output and I get warning when I compile it: