I have this code that's supposed to check if the "key" ie argv(1) but it's not working. "Segmentation fault"
Here it is:
string plain; //this is in advance for my for loop
//was unable to find a way to actually get the thing to handle a non-numeric key :(
int main(int argc, string argv[])
{
if (argc == 2 && isdigit(argv[1]))
{
plain = get_string("plaintext:");
printf("ciphertext:");
}
else
{
printf("Usage : ./caesar key\n");
return 1;
}
Thanks for help, if you need any more details please ask!