I'm calling out to all of those C++ programmers out there.
Does anyone know where the 'drand48()' function that's normally part of the stdlib.h is? I'm trying to compile a program using it and I always get the same message:
util.cpp: In function `double drand()':
util.cpp:30: implicit declaration of function `int drand48(...)'
Has 'drand48()' been removed from the stdlib.h? Has it been replaced? If so, what's the new function? If not, where can I get it?
Any ideas?
BTW: Here is the source code I'm working with:
#ifdef _WIN32
double drand() {
int ival;
double val;
ival = irand();
val = (double)ival/(RAND_MAX + 1);
ival = irand();
val = ((double)ival + val)/(RAND_MAX + 1);
return(val);
}
#else
double drand() {
double val;
val = drand48(); //<--Line 30
return val;
}
#endif