I have been working on Caesar for some time now and tried to use different loops but I am getting Segmentation Errors.
#include <stdio.h>
#include <cs50.h>
#include <stdlib.h>
#include <ctype.h>
int main (int argc, string argv[])
{
if (argc != 2 || !isdigit(argv[1]))
{
printf("Usage: ./caesar key");
return 1;
}
else
{
string plaintext = get_string("plaintext: ");
return 0;
}
}
I think this code should work but when I input something like ./caesar 2 I get a segmentation error. Can someone pin point what exactly is wrong?