Advertisement
Tchae

LaTruffe

Nov 11th, 2017
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef char * str ;
  5.  
  6. void affiche(char * mots[]){
  7.      while (*mots) puts(* (mots++));
  8. }
  9.  
  10. int main(int k, const str ldc[]){
  11.     char *mots[] = {"ab", "cd", "ed", NULL};    
  12.     // La ligne ci dessous renvoie l'erreur :
  13.     // lvalue required as increment operand
  14.     // alors que c'est exactement celle qui est dans la fonction affiche
  15.  
  16.     // while (*mots) puts(* mots++);  
  17.  
  18.     // De même ça fonctionne parfaitement pour afficher
  19.     // le tableau de chaines de la ligne de commande
  20.     while (*ldc) puts( *ldc++);
  21.  
  22.     affiche(mots);
  23.     return 0 ;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement