I tried to compile the following codes:
vector<char*> art = { "a","an","the" };
but received error message:
error C2440: 'initializing': cannot convert from 'initializer list' to 'std::vector<char *,std::allocator<_Ty>>'
1> with
1> [
1> _Ty=char *
1> ]
1> note: No constructor could take the source type, or constructor overload resolution was ambiguous
If i changed the element type to 'const char *' like this:
vector<const char*> art = { "a","an","the" };
it can be compiled.Can someone tell me the reason?Thanks a lot.