C/C++: Annalyser une syntaxe CSV

Author:


{filelink=13573}

#include 
#include 

int main()
{
  char doc[64]="Exemple, Cours, Tuto, C/C++";
  char mots[64][20];
  const char virgule = ',';
  const char espace = ' ';
  int compteur = 0;
  int size = 0;
  int i = 0;

  while(doc[i] != '')
  {
    while(doc[i] == espace || doc[i] == virgule)
      ++i;

    while(doc[i] != espace && doc[i] != virgule && doc[i] != '')
     mots[compteur][size++] = doc[i++];

    mots[compteur++][size] = '';
    size = 0;
  }

  printf("Résultat: ");
  for(i = 0 ; i
    

Leave a Reply

Your email address will not be published. Required fields are marked *

C/C++: Annalyser une syntaxe CSV

Author:


{filelink=13573}

#include 
#include 

int main()
{
  char doc[64]="Exemple, Cours, Tuto, C/C++";
  char mots[64][20];
  const char virgule = ',';
  const char espace = ' ';
  int compteur = 0;
  int size = 0;
  int i = 0;

  while(doc[i] != '')
  {
    while(doc[i] == espace || doc[i] == virgule)
      ++i;

    while(doc[i] != espace && doc[i] != virgule && doc[i] != '')
     mots[compteur][size++] = doc[i++];

    mots[compteur++][size] = '';
    size = 0;
  }

  printf("Résultat: ");
  for(i = 0 ; i
    

Leave a Reply

Your email address will not be published. Required fields are marked *

C/C++: Annalyser une syntaxe CSV

Author:


{filelink=13573}

#include 
#include 

int main()
{
  char doc[64]="Exemple, Cours, Tuto, C/C++";
  char mots[64][20];
  const char virgule = ',';
  const char espace = ' ';
  int compteur = 0;
  int size = 0;
  int i = 0;

  while(doc[i] != '')
  {
    while(doc[i] == espace || doc[i] == virgule)
      ++i;

    while(doc[i] != espace && doc[i] != virgule && doc[i] != '')
     mots[compteur][size++] = doc[i++];

    mots[compteur++][size] = '';
    size = 0;
  }

  printf("Résultat: ");
  for(i = 0 ; i
    

Leave a Reply

Your email address will not be published. Required fields are marked *