•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,543 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,305 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 3312 | Replies: 0
![]() |
I've created a file called country.txt which holds a list of 100 countries' name. Eg (to name a few):
America
Bahamas
Canada
Denmark
Eygpt
France
Germany
Hong Kong
My question is, how would I have the computer pick a random country name from the list above? Do I have to put a number at the front like below and use the random number generator? (if yes, can someone guide me on how to write in out in C++ format?)
1America
2Bahamas
3Canada
4Denmark
5Eygpt
6France
7Germany
8Hong Kong
Thank you!
America
Bahamas
Canada
Denmark
Eygpt
France
Germany
Hong Kong
My question is, how would I have the computer pick a random country name from the list above? Do I have to put a number at the front like below and use the random number generator? (if yes, can someone guide me on how to write in out in C++ format?)
1America
2Bahamas
3Canada
4Denmark
5Eygpt
6France
7Germany
8Hong Kong
Thank you!
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- problems with reading random access line from a file (C++)
- How we open a ms word document file with php? (PHP)
- get a random word (C++)
- getting words from .txt file (C++)
Other Threads in the C++ Forum
- Previous Thread: How Do I Repeat The Programm Without Go Back To Windows?
- Next Thread: pointer to member?

Linear Mode