[C help] how to... - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: [C help] how to... (/showthread.php?tid=27009) [C help] how to... by crank on 06-10-2004 at 02:32 PM
I'm working on a new version of QTSender (look over here) code: I know the formatting will work the only thing I'm wondering about is how to load it. EXAMPLE: You type /xQThello and it outputs: Hello buddy! I'm working in C. RE: [C help] how to... by RaceProUK on 06-11-2004 at 10:09 AM
code:The rand() function returns a number from 0 to MAX_INT (32,767 I think). By using the modulo division operator %, you can replace <out-of> with an integer e.g. use 10 to get a random number from 0-9 inclusive. RE: [C help] how to... by crank on 06-11-2004 at 01:26 PM
quote: I know that I'm just wondering how to get it from the file... RE: [C help] how to... by RaceProUK on 06-11-2004 at 01:30 PM
Ah right. In that case, what I would do is read each line of text from the file into an array, then use the random number generated to index the array. RE: [C help] how to... by crank on 06-11-2004 at 01:38 PM
I never worked with files before so some extra info would be nice... RE: [C help] how to... by RaceProUK on 06-11-2004 at 01:41 PM
I've never worked with files in C/C++ either, so I'll refer you to the rather good (if a little hard to use) MSDN Website. Just search for 'file reading C' and you should get some relevant results. |