Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

random number generation

akcpakcp Member Posts: 1
[size=3]how can we generate random function in win32 application
like we use randomize() and random() functions in console applications[/size]

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    [code]
    #include
    #include
    #include

    void _10_numbers_from_0_to_31 ()
    {
    TCHAR buf [80];
    PTCHAR psz = buf;

    srand (::GetTickCount ());
    for (int i=0; i<10; i++)
    {
    int len = ::wsprintf (psz, "%d,", rand () % 32);
    psz += len;
    }
    ::MessageBox (NULL, buf, "TEN RANDOM VALUES", MB_ICONINFORMATION);
    }
    [/code]
Sign In or Register to comment.