Name:
Anonymous
2009-10-02 22:00
You know when your program is useful when you spend more time using it then developing it.
Name:
Anonymous
2009-10-03 4:26
Ensure that all of your local variables are set to null or 0 at the end of their scope, so the computer knows they're finished being used, like so:
int Add(int valueToBeAddedToBySecondArgument, int valueBeingAddedToFirstArgument)
{
int temporaryValueOfTheFirstAndSecondArguments;
if(valueToBeAddedToBySecondArgument == 0)
{
temporaryValueOfTheFirstAndSecondArguments = valueBeingAddedToFirstArgument;
}
else if(valueBeingAddedToFirstArgument == 0)
{
temporaryValueOfTheFirstAndSecondArguments = valueToBeAddedToBySecondArgument;
}
else
{
temporaryValueOfTheFirstAndSecondArguments = valueToBeAddedToBySecondArgument;
temporaryValueOfTheFirstAndSecondArguments = temporaryValueOfTheFirstAndSecondArguments + valueBeingAddedToFirstArgument;
}
valueToBeAddedToBySecondArgument = 0;
valueBeingAddedToFirstArgument = 0;
return temporaryValueOfTheFirstAndSecondArguments;
temporaryValueOfTheFirstAndSecondArguments = 0;
}
If you do not do this your computer will run out of memory very, very fast and can cause a virus to infect your motherboard!