Ok, my main code looks like this now. Also for some reason when I input 's' as a encryption type it outputs
Original word is: good
Segmentation fault
But when I try to do 'm' or 'u' the program just terminates, any thoughts?
Code:#include"encrypt.h"//make your function declaration in this .h file #include<stdio.h> int main() { char input[20], encrypt[20]; printf("Please enter a sentence to encrypt: "); scanf("%s", &input); printf("Please enter encryption level, 's' for simple, 'm' for medium, or 'u' for ultra:"); scanf("%s", &encrypt); if(encrypt[0] == 's') { printf("Original word is: "); printf("%s\n", input); printf("Encrypted word is: "); simpleEncrypt(*input); printf("%s",input); } else if(encrypt[0] == 'm') { printf("Original word is: "); printf("%s\n", input); printf("Encrypted word is: "); printf("%s",mediumEncrypt(input)); } else { printf("Original word is: "); printf("%s\n", input); printf("Encrypted word is: "); printf("%s",ultraEncrypt(input)); } return 1; }



LinkBack URL
About LinkBacks



