Given the function declaration (prototype), does the compiler complain or compile if you call this using the following line? If the compiler complains, what is the complaint?
```
//if score >= min_to_pass, returns 'P' for passing,
//else returns 'F' for failing.
char grade (int score, int min_to_pass);
int main() double fscore;
char fgrade;
int need_to_pass;
//omitted code to get values for variables
//fscore and need
fgrade = grade(fscore, need);
return 0;
```
What will be an ideal response?
The compiler complains about using a double for a parameter for a function
calling for an int parameter. The reason is the C++ strong type checking. There is
a possible loss of information when a double is sent to any kind of integer
(char, int, long) parameter, or assigned to an integer. Warning messages
from the Gnu g++ compiler are:
Line 14: warning: float or double used for argument 1
double grade(int, int);
You might also like to view...
The Instruction Fetch is implemented in the text with first 4 states and then three. What would have to be done to the datapath to make it two states long?
What will be an ideal response?
Consider the following list:int list[] = {4, 8, 19, 25, 34, 39, 45, 48, 66, 75, 89, 95}When performing a binary search for 75, after the first comparison, the search is restricted to ____.
A. list[0]...list[6] B. list[0]...list[7] C. list[5]...list[11] D. list[6]...list[11]