Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cs50.h>
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- #include <stdlib.h>
- int main(int argc, string argv[])
- {
- if (argc != 2) //if user doesn't run command-line argument of one or enter positive int
- {
- printf("Usage: ./vigenere key\n"); //prompt them to run it again
- return 1; //returning zero means everything went well
- }
- for (int j = 0, n = strlen(argv[1]); j < n; j++) //length of the entire string. Save n as strlen for use in loop
- {
- if (isalpha(argv[1][j])) //if user doesn't run command-line argument of one or enter positive int and user inputs an alpha key, continue
- {
- //printf("%c\n", argv[1][j]); //Print after collecting plaintext
- }
- else
- {
- printf("Usage: ./vigenere key\n"); //prompt them to run it again
- return 1; //returning zero means everything went well
- }
- }
- string p = get_string("plaintext: "); //prompt for plaintext and store
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement