extern "C" { #include // getpid } // extern "C" #include #include // random int main() { rand48seed( getpid() ); // set random seed // test polymorphic calls to random and stream char c = rand48(); sout | c | endl; int i = rand48(); sout | i | endl; unsigned int ui = rand48(); sout | ui | endl; long int li = rand48(); sout | li | endl; unsigned long int uli = rand48(); sout | uli | endl; float f = rand48(); sout | f | endl; double d = rand48(); sout | d | endl; float _Complex fc = rand48(); sout | fc | endl; double _Complex dc = rand48(); sout | dc | endl; long double _Complex ldc = rand48(); sout | ldc | endl; } // main // Local Variables: // // tab-width: 4 // // compile-command: "cfa random.c" // // End: //