Hi all!
I am making a random password generator (source code below). The user enters the amount of characters the password must be, and depending on that value (Choice), the program calls the appropriate function. I haven't worked out the whole switch statement and the other functions yet, but the meaning is clear, I hope :). The problem is: when I run the program (it compiles without problems) and enter 1 in Choice, the program outputs all 62 possibilities, and then Windows gives the error: "Naamloos2.exe doesn't work anymore." Does anyone know a solution? Thanks in advance!
No, I want to generate every order of characters that is possible using the characters in a . Of course, passwords of one character aren't useful, but I want to use in for example generateTen() nine extra embedded for-loops, in each for-loop using another string, so that all possible orders with all that characters are generated and outputted. (sorry if you don't understand it, my English isn't good :( ). And I added return 0; , but that didn't work. I thought that functions in c++ return 0 by default.
Any other suggestions?
I added return 0; , but that didn't work. I thought that functions in c++ return 0 by default.
The main function is an exception and will return 0; if nothing was returned. For all other functions you have to use a return statement to return a value.
Maybe the problem is that generateOne() doesn't return anything. If you don't want it to return anything you should make the return type void.