View Single Post
 
Reply
Posted 2004-01-04, 11:47 AM in reply to Randuin's post "C++ Randomity Help"
EDIT:: This is Acer Posting, I didnt relize MarkiX logged on this computer

Chruser said:
Give the int functions return values, or change the function type to void.
yes this function has no return...

int statGen(int stat)
{
srand ( (unsigned)time( NULL ) );
stat = rand();
}

you are also can assign a value to stat, you cant unless its a *pointer]

so you could do this...

void statGen(int* stat)
{
srand ( (unsigned)time(NULL) );
stat = rand();
}


that should be right... dont have VC++ to test sorry
Old
Profile PM WWW Search
MarkiX is neither ape nor machine; has so far settled for the in-betweenMarkiX is neither ape nor machine; has so far settled for the in-between
 
 
MarkiX