Here is a complete function that purports to return one of the roots of a quadratic given suitable parameters. It looks good, but fails to compile. Why?
```
//returns one of the roots of the quadratic equation
//a*x*x + b*x + c = 0 a!= 0
double root1 (double a, double b, double c)
{
return (-b + sqrt(b*b-4*a*c))/(2*a);
}
```
The function sqrt, called in the body of the function root1, has no declaration (or prototype) given. The rest of the code is correct. The following preprocessor directive is needed prior to the definition of the function root to get a declaration of sqrt.
#include
Some systems will create a declaration of an un-type-checked function, to allow the compiler to find other errors. The user is warned, but linking usually fails in this event.
You might also like to view...
Computers process data under the control of sets of instructions called ___________.
Fill in the blank(s) with the appropriate word(s).
The Opacity slider is on the ____ panel.
A. Opacity B. Bitmap C. Transform D. Transparency
A(n) ____ is a data type that separates the logical properties from the implementation details.
A. public B. protected C. private D. abstract data type
Working in Outline view shows exactly how the text will look on the slide.
Answer the following statement true (T) or false (F)