Solved

Question on random number

Posted on 1998-11-11
1
162 Views
Last Modified: 2013-11-20
Hi there,

         Is there any function(s) in MFC programming that I can use to generate random numbers?

Any help offered is very much appreciated!
0
Comment
Question by:justinng
1 Comment
 
LVL 2

Accepted Solution

by:
cyrilbdt earned 20 total points
ID: 1324548
help sample for rand function

/* RAND.C: This program seeds the random-number generator
 * with the time, then displays 10 random integers.
 */

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

void main( void )
{
   int i;

   srand( (unsigned)time( NULL ) );
   for( i = 0;   i < 10;i++ )
      printf( "  %6d\n", rand() );
}

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 98
Replacement selected text 2 47
post4 challenge 28 83
sumHeights2  challenge 7 78
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now