PaCkEtPiRaTe wrote: string password += characters[rand()%characters_len];
You are using 2 String Password declarations ...
remove the second one within the braces.. it should work
PaCkEtPiRaTe wrote: string password += characters[rand()%characters_len];

// Random Password Generator by ----------------------.
// Copyright © 2008-2013. All rights reserved.
#include <iostream>
#include <fstream.h>
#include <stdlib.h>
using namespace std;
int main() {
srand(time(NULL));
int pass_Length = 0;
char characters [] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '\0' };
int characters_len = sizeof(characters) / sizeof(char);
string password;
while (pass_Length < 20) {
string password += characters[rand()%characters_len];
pass_Length++;
}
ofstream fout("password.txt");
fout << "The password generated was: " << password << "\n";
fout << flush;
fout.close();
cout << endl;
system("PAUSE");
return 0;
}

AbaxHacker wrote:You either were using a clr console and it didn't work or a windows, vice versa or you had no pre-compiled header this time.




Users browsing this forum: No registered users and 0 guests