|
|
От: |
Bell
|
|
| Дата: | 11.04.08 09:45 | ||
| Оценка: | |||
B>>std::vector<const char*> ptr_array(vec.size());
B>>std::transform(vec.begin(), vec.end(), ptr_array.begin(), std::mem_fun_ref(&std::string::c_str));
K13>21.3.6 basic_string string operations
const charT* c_str() const;
1 Returns: A pointer to the initial element of an array of length size() + 1 whose first size() elements
equal the corresponding elements of the string controlled by *this and whose last element is a
null character specified by charT().
2 Requires: The program shall not alter any of the values stored in the array. Nor shall the program treat the
returned value as a valid pointer value after any subsequent call to a non-const member function of the
class basic_string that designates the same object as this.