Created
June 19, 2016 19:22
-
-
Save KowalczykBartek/e475583ae8074858d74d37764f1b5814 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int sprawdzanie_argumentow(char** argv,char* argument) | |
{ | |
int b = 1; | |
while ( b < 8 ){ | |
if (strcmp(argv[b],argument) == 0){ | |
printf("ARGV %s\n",argv[b]); | |
return 0; | |
} | |
else{ | |
printf("ARGV = %s \n",argv[b]); | |
b++;} | |
} | |
return 1; | |
} | |
int main(int argc, char** argv) | |
{ | |
FILE *we, *wy; | |
char a; | |
int b = 1; | |
int what = 0; | |
char* compressionFlag = "-e"; | |
if (argc != 8 ){ | |
pomoc(); | |
return 0; | |
} | |
if (sprawdzanie_argumentow(argv,compressionFlag) == 0) | |
printf("wyszło 0 \n"); | |
else | |
printf("wyszlo 1 \n"); | |
we = fopen(argv[1],"r"); | |
wy = fopen(argv[2],"w+"); | |
while ((a = getc(we)) != EOF) | |
{ | |
printf("%c",a); | |
putc(a,wy); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment