Hey,
I tried your Random Number generator on cprogramming.com and made a little program:
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
const int Q=1;
const int RAND_MAX=10;
int A;int mat;
int main () {
time_t seconds;
time(&seconds);
mat=rand() % (Q-1)+1;
cout<< mat;
}
First, I dont know why there is time in in, but who cares. Second, I always get the same result. I tried really stupid things like:
mat=rand() % 1;Q;
mat=rand() & (Q-1)+1;
but getting always the same thing.
I dont know or it has anything to do with it, but i use a Mac, with Xcode.
I hope You can help me,
Mathias
I tried your Random Number generator on cprogramming.com and made a little program:
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
const int Q=1;
const int RAND_MAX=10;
int A;int mat;
int main () {
time_t seconds;
time(&seconds);
mat=rand() % (Q-1)+1;
cout<< mat;
}
First, I dont know why there is time in in, but who cares. Second, I always get the same result. I tried really stupid things like:
mat=rand() % 1;Q;
mat=rand() & (Q-1)+1;
but getting always the same thing.
I dont know or it has anything to do with it, but i use a Mac, with Xcode.
I hope You can help me,
Mathias