Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Halp again. C woes... >_>
#2

Something like?:

Code:
int isDuplicate = 0;
int newNumber = your_random_number_function();

// check for duplicate
for(int i = 0; i < 6; i++)
{
    if(b[i] == newNumber)
    {
        isDuplicate = 1;
    }
}

if(!isDuplicate)
{
    // add to array here
}
Reply


Messages In This Thread
Halp again. C woes... >_> - by jwstohr - Feb 26, 2009, 12:13 PM
Halp again. C woes... >_> - by Drunken F00l - Feb 26, 2009, 01:23 PM
Halp again. C woes... >_> - by jwstohr - Feb 26, 2009, 01:44 PM
Halp again. C woes... >_> - by jwstohr - Feb 26, 2009, 02:00 PM
Halp again. C woes... >_> - by Drunken F00l - Feb 26, 2009, 02:11 PM
Halp again. C woes... >_> - by Versed - Feb 26, 2009, 06:14 PM
Halp again. C woes... >_> - by jwstohr - Feb 26, 2009, 10:54 PM
Halp again. C woes... >_> - by wieks - Feb 27, 2009, 09:26 PM
Halp again. C woes... >_> - by jwstohr - Feb 28, 2009, 03:13 AM
Halp again. C woes... >_> - by insomniaprincess - Feb 28, 2009, 10:11 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)