Which of the following function declarations with default arguments are correct?

a. void g(int length, int width, int height = 1);
b. void g(int length=1, int width, int height);
c. void g(int length, int width=1, int height = 1);
d. void g(int length=1, int width=1, int height);

a) and c)
Explanation: C++ allows default arguments. If a default argument is provided for a parameter, all parameters to the right of this must be provided with default arguments.

Computer Science & Information Technology

You might also like to view...

Promoted links are tiles that enable users to enter SharePoint sites or add tools to a site

Indicate whether the statement is true or false

Computer Science & Information Technology

A(n) ________detection system is hardware or software used to monitor network traffic for malicious activity. It can provide alerts when suspicious activity occurs and provide detailed logging information with professional reporting capabilities

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology