Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <sstream>
- int main() {
- std::string comando("oi mundo lindo");
- std::vector<std::string> cmd;
- std::string cmds;
- std::istringstream buf(comando);
- while (std::getline(buf,cmds, buf.widen(' '))) {
- cmd.push_back(cmds);
- }
- std::cout << cmd[0] << std::endl;
- std::cout << cmd[1] << std::endl;
- std::cout << cmd[2] << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement