Advertisement
Combreal

exeArguments.cpp

Mar 8th, 2023 (edited)
646
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | Source Code | 0 0
  1. #include <iomanip>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main(int argc, char* argv[])
  6. {
  7.     if (argv[1] != NULL) {
  8.         if (argv[1][0] == '/')
  9.         {
  10.             switch (argv[1][1]) {
  11.  
  12.             default:
  13.                 printf("Unknown option -%c\n\n", argv[1][1]);
  14.                 break;
  15.             case '?':
  16.                 printf("Helper. \n");
  17.                 break;
  18.             case 'V':
  19.                 printf("Version of the exe. \n");
  20.                 break;
  21.             case 'D':
  22.                 printf("Option D is found. \n");
  23.                 break;
  24.             }
  25.         }
  26.     }
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement