C:/C++: Parcourir un tableau à l’aide d’un pointeur

Author:

 pointeur
Download


#include 

int main(void)
{
  char str[] = "Comment comprendre les pointeurs facilement?";
  char *p;
  int i;

  p = str;

  /* Parcourir le tableau avec la réfenrence*/
  for(i = 0; p[ i ]; i++)
    printf("%c", p[ i ]);//Afficher simplement le contenu du tableau

  return 0;
}

Leave a Reply

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