Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string input = "2 columns 2 rows all * go"; // Read it from some input
- istringstream iss(input);
- vector<string> tokens;
- copy(istream_iterator<string>(iss),
- istream_iterator<string>(),
- back_inserter<vector<string> >(tokens));
- int columns = atoi(tokens[0].c_str());
- int rows = atoi(tokens[2].c_str());
Add Comment
Please, Sign In to add comment