"randomize" command is not working

Started by Arijit Pal, April 27, 2013, 12:26:31 AM

Previous topic - Next topic

Arijit Pal

#include<stdlib.h>
#include<stdio.h>
main()
{
   randomize();
   float u,d; int t;
   d =rand();
   u=(float)d/RAND_MAX;
   printf("   \n\n  random number is %f  ",u);
}


I coded this programme  to generate a random number. But pelles c shows unresolved external symbol "randomize. So how can I generate random numbers???? :( :( :( :( :(

Vortex

#1
randomize is not supported by Pelles C.
Code it... That's all...

jj2007

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

main()
{
   // randomize();
   srand(time(NULL));
   float u,d; int t;
   d =rand();
   u=(float)d/RAND_MAX;
   printf("   \n\n  random number is %f  ",u);
}