I am trying to run a code which gives the following
compilation error

error C2065: 'randomize' : undeclared identifier
error C2065: 'random' : undeclared identifier
Error executing cl.exe.

i am using Visual studio 6.0, Is there something that i am
supposed to include for this. i have already inculded the
following for diff reasons.

#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string.h>
#include <conio.h>
#include <process.h>
#include <stdlib.h>

Can anyone help me in identifying the problem
Regards
Ritu

Re: randomize() by a

a
Tue Jul 29 02:54:22 CDT 2003


here's a basic MSDN sample code
(wich you can find with Visual Studio 6 easily )

/* 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;

/* Seed the random-number generator with current time so that
* the numbers will be different every time we run.
*/
srand( (unsigned)time( NULL ) );

/* Display 10 numbers. */
for( i = 0; i < 10;i++ )
printf( " %6d\n", rand() );
}






Re: randomize() by John

John
Tue Jul 29 03:34:04 CDT 2003

"Ritu Khattar" <rkhattar16@hotmail.com> wrote in message
news:063101c355a0$7bcfa540$a601280a@phx.gbl
> I am trying to run a code which gives the following
> compilation error
>
> error C2065: 'randomize' : undeclared identifier
> error C2065: 'random' : undeclared identifier
> Error executing cl.exe.
>
> i am using Visual studio 6.0, Is there something that i am
> supposed to include for this. i have already inculded the
> following for diff reasons.
>
> #include <stdio.h>
> #include <iostream>
> #include <math.h>
> #include <string.h>
> #include <conio.h>
> #include <process.h>
> #include <stdlib.h>
>
> Can anyone help me in identifying the problem
> Regards
> Ritu


The fact that neither random nor randomize are defined in any standard
header might have something to do with it.


--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)


Re: randomize() by John

John
Tue Jul 29 04:09:18 CDT 2003

"John Carson" <donaldquixote@datafast.net.au> wrote in message
news:uyDLwwaVDHA.1480@tk2msftngp13.phx.gbl
>
>
> The fact that neither random nor randomize are defined in any standard
> header might have something to do with it.
>


For "defined", read "declared".


--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)

Re: randomize() by Phil

Phil
Tue Jul 29 10:28:57 CDT 2003

Ritu Khattar wrote:

> I am trying to run a code which gives the following
> compilation error
>
> error C2065: 'randomize' : undeclared identifier
> error C2065: 'random' : undeclared identifier
> Error executing cl.exe.

randomize() and random() are not standard C functions. What platform was your
code sample originally for?

--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com