Created
November 10, 2014 16:28
-
-
Save raven38/2725d4a56336f318ca8a to your computer and use it in GitHub Desktop.
vector<string>の要素を全て繋げてstringにする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <numeric> | |
using namespace std; | |
// T accumulate( InputIt first, InputIt last, T init ); | |
string concatvec(vector<string> expr){ return accumulate(expr.begin(), expr.end(), string(""));} | |
int main(){ | |
vector<string>vs; // 適当な文字列を入れてく | |
string s = concatvec(vs); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment