Advertisement
ssoni

args.c

Jan 26th, 2022
1,022
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <cs50.h>
  3.  
  4. int main(int argc, string argv[])
  5. {
  6.  
  7.  
  8.     printf("%i\n", argc);
  9.     printf("[0]=%s\n", argv[0]);
  10.     printf("[1]=%s\n", argv[1]);
  11.     printf("[2]=%s\n", argv[2]);
  12.     printf("[3]=%s\n", argv[3]);
  13.  
  14.  
  15.     if (argc != 2)
  16.     {
  17.         printf("USAGE: ./args NAME\n");
  18.         return 1;
  19.     }
  20.     else
  21.     {
  22.         printf("Hello, %s\n", argv[170]);
  23.         return 0;
  24.     }
  25.  
  26. }
  27.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement