Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #13381

portable rand/srand across linux,windows,etc

From JohnF <john@please.see.sig.for.email.com>
Newsgroups comp.lang.c
Subject portable rand/srand across linux,windows,etc
Date 2011-11-15 12:55 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <j9tngi$fm9$1@reader1.panix.com> (permalink)

Show all headers | View raw


Sorry if the wrong ng (please suggest another).
I'm looking for robustly portable stdlib entry points
for rand()/srand() (e.g., or random()/srandom()),
particularly across linux gcc and windows
mingw and djgpp (and ms compilers).
That is, I want to distribute one source, without
a lot of pesky #ifdef's, to compile on all platforms.
Would also be nice if portable across everything
else from free/netbsd to vms/dec C, too, but linux
and windows are the biggies. Google shows various
occasional complaints about rand stuff not compiling and/or
not working on windows. I don't need anything particularly
good -- just naked eye random, so to speak. And if it's
easier to just cut-and-paste source from Numerical Recipes,
I'm okay with that, too.
-- 
John Forkosh  ( mailto:  j@f.com  where j=john and f=forkosh )

Back to comp.lang.c | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

portable rand/srand across linux,windows,etc JohnF <john@please.see.sig.for.email.com> - 2011-11-15 12:55 +0000
  Re: portable rand/srand across linux,windows,etc Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-15 08:01 -0500
  Re: portable rand/srand across linux,windows,etc Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-11-15 13:14 +0000
    Re: portable rand/srand across linux,windows,etc JohnF <john@please.see.sig.for.email.com> - 2011-11-15 13:46 +0000
      Re: portable rand/srand across linux,windows,etc Keith Thompson <kst-u@mib.org> - 2011-11-15 14:09 -0800
        Re: portable rand/srand across linux,windows,etc JohnF <john@please.see.sig.for.email.com> - 2011-11-16 03:45 +0000
          Re: portable rand/srand across linux,windows,etc Keith Thompson <kst-u@mib.org> - 2011-11-15 20:11 -0800

csiph-web