- 1

whats wrong with this login i forgot to add main function and headers and yes i did have return 0; at the end

char Pone; char Ptwo; char Pthree; char Pfour; char Pfive; char Psix; char Pseven; char Peight; char One; char Two; char Three; char Four; char Five; char Six; char seven; char Eight; char Nine; char Ten; cout << "Enter your username, Make sure it's 10 characters long."; cin >> One >> Two >> Three >> Four >> Five >> Six >> seven >> Eight >> Nine >> Ten; bool c = isdigit(One); bool ch = isdigit(Two); bool che = isdigit(Three); bool chec = isdigit(Four); bool check = isdigit(Five); bool checki = isdigit(Six); bool checkin = isdigit(seven); bool checking = isdigit(Eight); bool checkingc = isdigit(Nine); bool checkingch = isdigit(Ten); cout << endl; for (int i = 0; i < 100000; i++) { if (c && ch && che && chec && check && checki && checkin && checking && checkingc && checkingch == 1) { cout << "Username must contain a letter, pleae reenter your username "; cin >> One >> Two >> Three >> Four >> Five >> Six >> seven >> Eight >> Nine >> Ten; } } string password; cout << "Enter Random for random password, enter anything else to get to choose your password" << endl; cin >> password; if (password == "Random") { string data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklnmopqrstuvwxyz" "1234567890" "@#',.

amp;^-_+={}[}()*?!%\/`<>"; string pass; for (int i = 0; i <= 8; i++) { pass = pass + data[rand() % data.length()]; } cout << "Your random password is " << pass << "\n"; } else { cout << "Enter your Password, Make sure it's 8 characters long and make sure there is no tilde~"; cin >> Pone >> Ptwo >> Pthree >> Pfour >> Pfive >> Psix >> Pseven >> Peight; } cout << "Your Username is " << One << Two << Three << Four << Five << Six << seven << Eight << Nine << Ten << endl <<

28th Jul 2022, 10:15 PM
Renz
10 Réponses
0
Thank you so much
29th Jul 2022, 12:22 PM
Renz
- 1
Put the c, ch ... checkingch inside the for loop. Those only get evaluated the first time.
29th Jul 2022, 1:06 AM
Lama
Lama - avatar
- 1
They are in the for loop in the if statement
29th Jul 2022, 3:07 AM
Renz
- 1
No, like the bool c = isDigit(One)...
29th Jul 2022, 3:19 AM
Lama
Lama - avatar
- 1
Yeah "c" if(c&&ch.....
29th Jul 2022, 3:56 AM
Renz
- 1
Move the "for(int i = 0; i < 100000; i++) line before "bool c = isDigit(One)".
29th Jul 2022, 12:14 PM
Lama
Lama - avatar
- 1
Ok
29th Jul 2022, 12:15 PM
Renz
- 1
It is before
29th Jul 2022, 12:16 PM
Renz
- 1
Put these inside the for loop. bool c = isdigit(One); bool ch = isdigit(Two); bool che = isdigit(Three); bool chec = isdigit(Four); bool check = isdigit(Five); bool checki = isdigit(Six); bool checkin = isdigit(seven); bool checking = isdigit(Eight); bool checkingc = isdigit(Nine); bool checkingch = isdigit(Ten);
29th Jul 2022, 12:19 PM
Lama
Lama - avatar
- 1
Ok
29th Jul 2022, 12:19 PM
Renz