Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <cmath>
- #include <fstream>
- using namespace std;
- int main(int argc, char** argv) {
- const char *wejscie;
- const char *wyjscie;
- if (argc != 5) {
- cout << "blad parametrow";
- return 0;
- }
- /*if(strcmp(argv[1],"-i") == 0) {
- wejscie = argv[2];
- wyjscie = argv[4];
- } else if (strcmp(argv[1],"-o") == 0) {
- wejscie = argv[4];
- wyjscie = argv[2];
- } else {
- cout <<"blad parametrow";
- return 0;
- }
- cout <<wejscie<<' '<<wyjscie;
- */
- for(int i=1;i<=argc;i++) {
- if (strcmp(argv[i], "-i") == 0){
- wejscie = argv[i+1];
- } else if(strcmp(argv[i],"-o") == 0) {
- wyjscie = argv[i+1];
- }
- }cout<<wejscie<<' '<<wyjscie ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement