I tried the following code:
int main() { int x {23.22}; }
which includes initialization, which requires narrowing, but the code compiles without any errors or warnings. On the other hand, the following code gives an error:
int main() { int x[]{23.22}; }
I found a mistake or what?
PS: I am currently using GCC 4.5.0
c ++ c ++ 11 g ++
Saurabh manchanda
source share