0/1 minus 2/3
if the user wants to have a negative number. If you want to put in
negative numbers, that is fine for an extra feature. In that case,
you may assume that only the numerator is negative (e.g., -2/3).
printf("Trying StringToInteger...\n") ;
n = StringToInteger("17") ;
/* This print statement has no \n */
printf("Did the new function work?") ;
/* The program dies here from division by zero */
x = 0 ;
n = 17 / x ;
In this example, you might think that the program crashed using
StringToInteger because, "Did the new function work?" never appeared
on the screen. That is not the case.