View Single Post
Old Mar 26th, 2008, 7:39 PM   #3
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,007
Rep Power: 5 lectricpharaoh will become famous soon enough
Re: duplicate numbers in arrays

I made a boo-boo:
Quote:
Originally Posted by lectricpharaoh
C++ Syntax (Toggle Plain Text)
  1. if(isValueInArray(n, list, idx)
  2. {
  3. list[idx] = n;
  4. ++idx;
  5. }
You need to invert that condition, and I missed a parenthesis:
if(!isValueInArray(n, list, idx))
{
  list[idx] = n;
  ++idx;
}
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote