Random word gen help!

Discussion in 'Software' started by Recycle Bin, Jun 7, 2009.

  1. Recycle Bin

    Recycle Bin Private First Class

    I'm trying to make a program to generate a bunch of random words or numbers and this is what I have so far:

    #include <cstdlib>
    using namespace std;

    void rword (char *word)
    {
    int len = rand () % 6 + 1;
    word [len] = 0;
    while (len) word [--len] = 'a' + rand () % 26;
    }

    int main ()
    {
    char word[7];
    char word2[7];
    int x=0;
    srand(2345); // wut?
    while (x<500000)
    {
    rword(word);
    rword(word2);
    cout << word << ' ' << word2 << endl; Says there is an error here.
    //printf ("%s\n", word);
    x++;
    }
    }



    What do I do?

    I'm also trying to get this word generator to enter the random words into another program.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds