NO

Author Topic: "randomize" command is not working  (Read 1812 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: 529
    • 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: 515
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);
}