There are a few errors in my code, but the one I really don't understand is
`caesar.c:25:42: error: invalid operands to binary expression ('string' (aka 'char *') and 'int')
int c = ((int)text + argv[1]) % 26`
Here is my code:
#include<cs50.h>
#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include<stdlib.h>
int main(int argc, string argv[])
{
for(int i = 0, n = strlen(argv[1]); i < n; i++)
{
//make sure the key is valid
if(argc == 2 && isdigit(argv[1]))
{
//calculate cyphertext
int atoi(argv);
string text = get_string("plaintext: \n");
if(islower(text[i]))
{
text -= 97;
}
else if(isupper(text))
{
text -=65;
}
int c = ((int)text + argv[1]) % 26
}
else
{
printf("Usage: ./caesar key");
};
}
}