Not sure what you mean by random identifier. But consider
the following:
#include <cstdlib>
#include <ctime>
using namespace std;
int main( int argc, char *argv[] )
{
int random_number = 0;
int random_num_again = 0;
double percent = 0.0;
/* Usually you only have to do this once in a program
*/
srand( (unsigned int) time( (time_t *) 0 ) );
random_number = rand( );
/* Random numbers between 0 to 9 */
random_num_again = rand( ) % 10;
/* Random numbers between 0.0 to 1.0 */
percent = rand( ) / ((double) RAND_MAX);
return 0;
}
--- MoMaFuckEup <[EMAIL PROTECTED]> wrote:
> Hello,
> I am just learning C++ and I want to know the header file
> used when
> you want to genearte random numbers and the syntax of
> random
> identifier.
>
>
>
_________________
Joseph A. Marrero
http://www.l33tprogrammer.com/
____________________________________________________________________________________
Finding fabulous fares is fun.
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel
bargains.
http://farechase.yahoo.com/promo-generic-14795097