How to view the content of a built-in function

Hi all

Is it possible to see the content of a built-in function? I want to see how rand() works.

Thanks
Have you checked the cstdlib header to see if it's in there? It's been a while since I looked in a header like that, I'm not sure how easy it is to find what you're looking for.

I think, by default, rand uses a linear congruential generator algorithm to generate it's PNR from the seeded value.

http://en.wikipedia.org/wiki/Linear_congruential_generator
closed account (zb0S216C)
You'll need the compiler's source code for that, since each compiler may implement "rand( )" differently. If you're using MSVC++, you're not going to be able to obtain the source code. GCC, however, is open-source.

Wazzak
Topic archived. No new replies allowed.