User Name Password Register
DaniWeb IT Discussion Community
All
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
Closed Thread
Join Date: Aug 2004
Location: Malaysia
Posts: 19
Reputation: Pikachu is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Pikachu's Avatar
Pikachu Pikachu is offline Offline
Newbie Poster

Help Selecting random word from file (C++)

  #1  
Aug 12th, 2004
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!
AddThis Social Bookmark Button
 
Closed Thread

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 5:00 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC