Last active
December 14, 2015 14:38
-
-
Save jedahan/5101940 to your computer and use it in GitHub Desktop.
caesar encoding
This file contains hidden or 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
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| char secret[] = "MY SECRET STRING"; | |
| int main(int argc, char *argv[]) { | |
| char encoded[strlen(secret)]; | |
| int i; | |
| printf("Shifting '%s' by %d:\n", secret, atoi(argv[1])); | |
| for(i=0; i < strlen(secret); i++) { | |
| encoded[i] = secret[i] + atoi(argv[1]); | |
| } | |
| printf("%s\n",encoded); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment