Write the definition of a function zeroIt, which is used to zero out a variable. The function is used as follows: int x=5; zeroIt(&x); /* x is now equal to 0 */
LANGUAGE: C++
CHALLENGE:
Write the definition of a function zeroIt, which is used to zero out a variable. The function is used as follows: int x=5; zeroIt(&x); /* x is now equal to 0 */
SOLUTION:
void zeroIt( int *x){ *x=0; }