C/C++: Exemple d’utilisation de string comme paramètre d’une fonction

Author:


Download


#include 

/* Prototype de la fonction */
void f(char *string);

int main(void)
{
  f("this is a test");

  return 0;
}

void f(char *string)
{
  while(*string)
  { /* Parcourir la chaîne caractère par
				     par caractère */
    printf("%c", *string);
    string++;
  }
  printf("");
}

Leave a Reply

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