|
Re: Stupidest Programming Mistakes
My teammate made a great slipup that him and a mentor didn't catch till I looked. Here it is (with the error) in a function for averaging something in pseudocode.
Code:
int sum,count;
while(stuff_left)
{
sum+=stuff;
count++;
}
if(!count == 0)
return -1
else
return sum/count;
__________________
Team 694
2005 Championship - Galileo Semifinalist
2005 New York - Regional Chairmans Award
2005 New York - Semifinalist (Thanks 1257,1340)
|