Is this a valid C statement ?
- by Philando Gullible
Lets say I write char c[99] = {'Stack Overflow'}; in C or C++ it does compiles fine but does this valid? By valid I meant not invoking any kind of undefined or unspecified behavior.
Again if I write char c[99] = 'Stack Overflow'; gcc complains about multicharacter constant which is obvious but in the above when I am enclosing within curly brackets compiler is happy! why is it so ?
I also notice that puts(c); after the first statement will output 'w' precisely the last character of a general string in-place of Stack Overflow. why so ?
Could somebody explain this behavior may be separately.