All pastes #248771 Raw Edit

Trucs

public text v1 · immutable
#248771 ·published 2006-11-14 23:52 UTC
rendered paste body
#include <iostream>
#include <string>
#include <vector>
 
using namespace std;
 
int
  main()
{
  vector <string> arg;
  int nbr;
  string ligne = "a b c d";
  int binf, bsup;
  string tmp;
 
  cout << ligne << endl;
  for(binf = 0; ligne[binf] != '\0';)
  {      
        for(; ligne[binf] ==' '; binf++);
        bsup = binf;
        if(ligne[binf] != 0)
        {
        	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+1;
        }
    }

return 0;
}