NO

Author Topic: "randomize" command is not working  (Read 2752 times)

Arijit Pal

  • Guest
"randomize" command is not working
« on: April 27, 2013, 12:26:31 AM »
#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???? :( :( :( :( :(

Offline Vortex

  • Member
  • *
  • Posts: 802
    • http://www.vortex.masmcode.com
Re: "randomize" command is not working
« Reply #1 on: April 27, 2013, 10:32:59 AM »
randomize is not supported by Pelles C.
« Last Edit: April 27, 2013, 10:39:48 AM by Vortex »
Code it... That's all...

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: "randomize" command is not working
« Reply #2 on: April 27, 2013, 10:33:18 AM »
#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);
}