Q:

Given the following declarations, determine which calls are legal and which are illegal. For those that are illegal, explain why

0

Given the following declarations, determine which calls are legal and which are illegal. For those that are illegal, explain why.

double calc(double);
int count(const string &, char);
int sum(vector<int>::iterator, vector<int>::iterator,
int);
vector<int> vec(10);

(a) calc(23.4, 55.1);

(b) count("abcda", 'a');

(c) calc(66);

(d) sum(vec.begin(), vec.end(), 3.8);

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

(a) Illegal. Only one parameter is needed for the function.

(b) Legal.

(c) Legal.

(d) Legal.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now