Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
char *values = " 3 1 4 15"; vector<int> array;
配列に値を入力したいのですが、
3,1,4,15
stlコピーアルゴリズムでそれを行うための巧妙な方法はありますか?
確かにある:
std::istringstream iss(values); std::copy(std::istream_iterator<int>(iss), std::istream_iterator<int>(), std::back_inserter(array));