Generation

generate functionSat, 12 Nov 2022

make random english name from online dictionary

#include <iostream> #include <stdlib.h> #include <string> #include <fstream> using namespace std; int main() { string s; ifstream file("dictionary.txt"); int r = rand() % 387761; while (file >> s) { r--; if (r == 0) { cout << s << endl; break; } } }

Questions about programming?Chat with your personal AI assistant