I am focusing on lower case only until I get it working, any help??
if(argc != 2) // if not two line commands prints error and stops program
{
printf("Please enter a single key");
return 1;
}
{
if(argc == 2)// checks to see if it has only two line commands
;
for(k = 0, n = strlen(argv[1]); k < n; k++)
{
if (isdigit(argv[1][k]) )
{
printf("error");
return 1;
}
string key = argv[1];//command line keyword to help encrypt
int keylengh = strlen(key);
printf("\n" "Enter your text to be converted""\n");
string text = GetString();// request the text to be converted
for (i = 0, k=0, n = strlen(text); i < n; i++,k++)
{
if (islower(text[i]))
{
// shifts the lower case text to be printed by the amount of the key
printf("%c", ((text[i]-'a' ) + ((key[k%keylengh])-'a')%26) + 'a');
}
else
{
printf("sorry");
}
}
}