char * words[] = {"stately", "plump", "buck", "mulligan"};
// calculate how many elements in words
size_t words_size = sizeof(words)/sizeof(char *);
// use entire array to initialize words2
list<string> words2(words, words + words_size);//出错
树上的代码,但是那一行一直出错,错误提示:
error C2664: '··· : c
annot convert parameter 1 from 'char *[4]' to 'unsigned int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
求指教 |