I have been writing a program that uses scanf to scan in a number. It doesn't seem to work very well. I have heard that scanf does not do error checking. But is there a way to check the return status of scanf to see if it read in a number correctly? if not, is there a better way to do this? And yes, I have read the FAQ's, but still haven't got to the point where I feel comfortable using pointers and arrays yet, so some of the examples there can be kind of confusing.
Next, what is the difference between the "return" and "exit" functions? They obviously do something different, but I am not sure what.
And last, how do I include debugging information in my program?
I am using gcc 2.95 running on a SunOS 4.1.4 with a sparc processor.
Any advice would be appreciated.