Advertisement
nRikee

llistaArguments - FSO

Sep 26th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #include <stdlib.h>
  4.  
  5.  
  6.  
  7. int main(int argc, char **argv)
  8.  
  9. {
  10.  
  11.     if(argc==0) printf("No se han introducido parametros. Introduce uno o mas parametros.");
  12.     else{
  13.         int a;
  14.         for (a=0;a<argc;a++){
  15.             printf("\nArgumento %i es %s", a, argv[a]);
  16.         }
  17.         printf("\n");
  18.     }
  19.     return 0;
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement