|
From: <wa...@wa...> - 2004-02-13 16:45:27
|
On 13 Feb 2004 at 16:26, Can Canova wrote: > hi, > I'm trying to make a windows api program which will take a random line > from txt file , will be refresh with button . Is there any one who can > help me? Thanks Can ------------------ Here's basically what you want to do: 1. You should probably read the entire text file into memory. 2. Treat each line in the text file as a string. 3. Load each of these strings into a vector of strings. 4. Then you can grab a random number from 1 to the size of the vector to grab a random line. That's the basix of what you're going to have to do. However, if you're going to have to do this through windows, you're going to have to learn how to get input and output working with the API. There are several Windows tutorials out there that can help you do that. Take a look at: http://freespace.virgin.net/james.brown7/tutorials.html http://www.foosyerdoos.fsnet.co.uk/ Although there really are a ton of tutorials if you just search for Windows C++ tutorial. Watson (the pencil neck) Davis |