Code like this can work fine:
char str[] = {'a', 'b', '\0'};
The left is an auto variable(array).
Code like this can NOT work:
char *str = {'a', 'b', '\0'};
The left side is a pointer. The pointer points to an unknown space, so this will fail.
My question is, what is the type of the right side?
In C++ 11, an initialize list becomes std::initializer_list. But what about old C++ 03?
In C++03 a brace-enclosed initializer is just a syntactic device that can be used to initialize aggregates (such as arrays or certain types of classes or structs). It does not have a ‘type’ and can only be used for those specific kinds of initializers.