Advanced error checking and structures, C/C++ Programming

Assignment Help:

   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.


Related Discussions:- Advanced error checking and structures

Explain difference between early binding and late binding, What is the diff...

What is the difference between early binding and late binding? What are advantages of early binding? a.) Late binding refers to function calls which aren't resolved until run t

Array, array itself is a pinter.explain

array itself is a pinter.explain

Determining the monthly payment on a mortgage loan, The following is the fo...

The following is the formula that can be used to complete that calculation: Monthly Payment = Monthly Interest Rate / (1 - (1 + Monthly Interest Rate) -Payment Interval )) *

Srand and rand(), Mention clearly about srand and rand().

Mention clearly about srand and rand().

Described multiple inheritance(virtual inheritance)?, Described multiple in...

Described multiple inheritance(virtual inheritance)? And explain its advantages and disadvantages? A: It is the procedure in which a child can be derived from more than one pare

What are control structures, What are control structures? - Control str...

What are control structures? - Control structures decide which instructions in program must be executed. - This implies that program flow may not necessarily move from one s

C program to calculate area of cube, Aim: To implement program to calculat...

Aim: To implement program to calculate area of cube using inline function. Code: inline void area_cube(float side) {             float area;             are

Output, #include void func(int num, b=5) { auto int total=0; static ...

#include void func(int num, b=5) { auto int total=0; static int sum=0; for ( int i=num; i>0 ; i--) total+=i; sum+=total; cout

Write function that take array as argument, Write a function that takes an ...

Write a function that takes an array as the argument and returns the second largest element. Bonus (+5): Write a function that takes an array and a number n as arguments and return

Get all table list from current database , i am using otlv4 for database co...

i am using otlv4 for database connecttvity, while i try to get all tables list from current database using query "$SQLTables" no output is displayed though programe compiles coretl

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd