I am currently on CS50x’s PSET2, Caesar, trying to get a key from the user (the first step pretty much). I need to get the key from the user. I understand that it will be a string stored in argv2 and that I need to convert it to an integer. I am currently attempting to do so by calling the integer “key” and converting argv2 to it but get the following error message: use of undeclared identifier argv. I thought argv does not have to be explicitly defined or declared? Could anybody help me with this single line of code (lol cry)? Thank you!
The code is below. (excluding header files)
int main(int argc, string argv[]);
// 1. Getting the key from the user
int key = atoi(argv2);