Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void deCaesar(FILE * input, FILE * output, int shift) {
- if (input == NULL || output == NULL)
- return;
- char c;
- shift %= 26;
- while ((c = fgetc(input)) != EOF)
- {
- if (c >= 65 && c <= 90)
- {
- if (c - shift >= 65)
- c -= shift;
- else
- c = c - shift + 26;
- }
- if (c >= 97 && c <= 122)
- {
- if (c - shift >= 97)
- c -= shift;
- else
- c = c - shift + 26;
- }
- fputc(c, output);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement