New answers tagged

1

Have you actually tested the program with an invalid char, like a number, in the key? Try using the alphabet with a 2 instead of an a and see what it does. It should be incredibly obvious why the program "timed out" while check50 was waiting for it to end. The fix should be very obvious too. If not, leave a message. If this answers your question, ...


1

It's a common mistake. Look at this code (comments removed): int main(int argc, string argv[]) { string key = argv[1]; The first line in main is trying to read argv[1]. If no parameter is given, then argc = 1 and argv[1] doesn't exist. (FYI, argv[0] contains the program name as it was entered when the program was invoked.) Because argv[1] doesn't ...


Top 50 recent answers are included