Mail Archives: djgpp/1998/08/05/01:15:54
> OK, OK, I have some questions.
>
> First off, how do you pass an int array as a parameter to a function?
void IntArrayFunc( int* thisIsAArrayOfInts ) {
thisIsAArrayOfInts[ 0 ] = 5;
}
int main() {
int aArray[ 29 ];
IntArrayFunc( aArray );
// It's passed, now aArray[ 0 ] has the value 5
}
> Second, how come both rand() and random() generate the same numbers again
> and again.. I can't find any sort of seed function to fix this. Is there
> one or am i using it wrong?
Can't see the problem. Post the source.
> Thanks in advance,
> -mark
Overall: Better to try alt.comp.lang.learn.c-c++
Thats for question not specially related to djgpp.
Uwe
- Raw text -