#include #include #include using namespace std; int main() { vector arg; int nbr; string ligne = "a b c d"; int binf, bsup; string tmp; cout << ligne << endl; for(binf = 0; binf < ligne.length(); binf++) { for(; ligne[binf] ==' '; binf++); bsup = binf; if(binf < ligne.length()) { for(; ligne[bsup] != 0 && ligne[bsup] !=' '; bsup++); cout << "binf=" << binf << " bsup=" << bsup << endl; arg.push_back(string(ligne,binf, bsup)); cout << arg.back() << endl; binf = bsup; } } return 0; }