Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------Decompressing method if the arguement being processed is d--------------------
- if(strcmp(argv[1],"d") == 0)
- {
- //While there are characters in the input file
- while((x = getc(inFile)) != EOF)
- {
- //Put the character in the output file
- putc(x, outFile);
- //If the previous character is equal to the current character
- if(x == z)
- {
- //Set x equal to the next character
- x = getc(inFile);
- //If it is the same character again
- while(x != 0)
- {
- putc(z,outFile);
- //Decrement the special character
- x--;
- }
- //Put the repeating character to the output file
- putc(z,outFile);
- }
- //Assign the previous character to x
- z = x;
- }
- counter = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement