Q:

Explain the effect of the second declaration in each one of the following sets of declarations. Indicate which, if any, are illegal

0

(a)

int calc(int, int);
int calc(const int, const int);

(b)

int get();
double get();

(c)

int *reset(int *);
double *reset(double *);

All Answers

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

(a)

    int calc(int, int);
    int calc(const int, const int);  // Same with first line, top-level `const` are ignored

(b)

 int get();
double get();  // Error, differ only on return types

(c)

int *reset(int *);
    double *reset(double *);  // OK, define an overloaded function

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