I am trying to get input from the console with this code but it gives me runtime exception at some memory location each time I try to run it and enter the first possible input. I am using Visual Studio 2010. I got same problems with MingW and Dev C++. However, the code ran fine with the old TurboC3 compiler.
int Nowhere(int x);
...
char* AtBashEncrypt(char* message);
char* AtBashDecrypt(char* encrypted);
int main()
{
char *input = "", *ciphertext = "", *plaintext = "";
system("cls");
printf("AtBash Cipher\nEnter a string to be encrypted: ");
gets(input); //this is where I get the error
ciphertext = AtBashEncrypt(input);
...
getch();
}
What could possibly be wrong with it?