it is standard on functions to provide


   It is standard on functions to provide some indication that the function has succeeded in its operation. Consider the Scanf function:

    scanf("%d",&number1);
 
If the function does indeed get a integer from the keyboard then everything is okay, but what happens if the user types in a char or float etc. The program might crash, it is common to write functions which never crash but return an error code. On the function scanf, the full prototype is

    int scanf("format",&variables);
 
The int is used to provide details of correct operation i.e. number of values  input or '-1' error . We can use this in programs to trap errors and repeat functions etc. The appended ANSI library shows full prototypes and meaning of return values from functions.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: it is standard on functions to provide
Reference No:- TGS0414826

Expected delivery within 24 Hours