|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
Anybody know how to Generate a random number?
If you check the pdfs that came with the compiler (CD:\mcc18\doc\MPLAB-C18-Libraries.pdf), there is a random number type thing, but I can't use it! Here: //Prototype int rand(void); //... /**************************************** * FUNCTION NAME: Random * PURPOSE: Returns a random char * CALLED FROM: Where ever * ARGUMENTS: none * RETURNS: unsigned char ****************************************/ unsigned char Random(void) { unsigned int rnd; rnd = Rand; rnd = rnd / RAND_MAX; return (unsigned char) (rnd & 0xFF); } The thing is, When I build, I get ...\user_routines.c:267:Error [1105] symbol 'Rand' has not been defined Help?!? |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A couple of noodle scratchers | Cheese Head | Programming | 11 | 07-12-2002 09:59 |
| Even more interesting numbers: Division of regional winners | archiver | 2001 | 8 | 24-06-2002 03:10 |
| More interesting numbers...specific to big-ball matches | archiver | 2001 | 13 | 24-06-2002 02:51 |
| How random is random???? | archiver | 1999 | 0 | 23-06-2002 21:59 |
| Help i need match numbers... | Drmoofdaddy | Championship Event | 5 | 26-04-2002 18:03 |