Because I heard that calling rand() multiple times will give you a sequence of random numbers that will repeat itself after a while (keeping the same seed). So it was just an exercise in statistics....
Type: Posts; User: achitan
Because I heard that calling rand() multiple times will give you a sequence of random numbers that will repeat itself after a while (keeping the same seed). So it was just an exercise in statistics....
all cards on the table, I'm using g++ compiler in an up-to-date Ubuntu 11.04 x_64 version
Thank you, laserlight!
I'll look into that. I'm new to C++ random number generation (also to C++, as a matter of fact).
Hi, all!
I really need a good random number generator for a baseball simulator (nothing fancy, just playing with probabilities). Currently I'm using the rand() function, and I've made a little test...
ok...thank you all for your input. I consider this matter closed. I got it to work using #!/bin/bash at the beggining of the source file and I called it with ./source_file (I also added a chmod u+x...
All great answers, thank you. I realize more and more that is a linux problem. Check this out:
I am in bash and when I do which source I get nothing. Think that's weird? source a_file works.
I...
First thank you for responding so quickly. Your idea about /bash/sh before executing the system() command may be the winner. I have to check that.
The return value of the system("source....")...
P.S.
Forgot to mention something. The program compiles and works almost perfectly. The system("source...") is the only problem.
Hello, everybody!
Here's a part of the code from a program I'm trying to do:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>