Is it possible to use rand() function on a txt file that i have used in a program??If so, how?
the file consists of a set of words out of which i want to select a random word every time the program is executed.
Is it possible to use rand() function on a txt file that i have used in a program??If so, how?
the file consists of a set of words out of which i want to select a random word every time the program is executed.
Read the file into an array of words.
Pick a random subscript to get your random word.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.