المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Any Suggetions for an efficient way?



C++ Programming
03-31-2009, 07:00 PM
Looking for an efficient way to do this with out getting duplicates.


int XLOW = 0;
int XHIGH = 10;
do
{
n = rand()% (XHIGH - XLOW + 1) + XLOW;
//for loop to check if value was
//previously used.
//When I put the loop in it takes forever.
//looking for an efficient way to check duplicates.
//any suggetions?
XHIGH--;
} while (XHIGH != 0);