jeudi 5 novembre 2015

Pick a random line from text file in C++

I'm trying to read a random line from a text file.

My code so far picks the first line, but I need a random line.

How would I get a random line?

string line;
if(infile.good()){
    getline(infile, line);
}

Aucun commentaire:

Enregistrer un commentaire