I have a program that I needed to create for a homework that is an Operating System Simulator. It's not as cool as it sounds. When I run it,
Is supposed to create a value that will initialize the "system clock" ( a static int ).
The program runs and does what it is supposed to, except there is no randomness in the results ( there should be differences in the amount of "time units", which are measured in blocks of time that is affected by this function call I believe.
Anyone help me make sure I'm doing this right? It's supposed to put that random # in the variable "now".
Code:
long now ; srand( system( "time(&now)" ) );
The program runs and does what it is supposed to, except there is no randomness in the results ( there should be differences in the amount of "time units", which are measured in blocks of time that is affected by this function call I believe.
Anyone help me make sure I'm doing this right? It's supposed to put that random # in the variable "now".
Comment