All pastes #248788 Raw Edit

Trucs

public text v1 · immutable
#248788 ·published 2006-11-15 00:17 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; 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;
}