Random question, please help asap
Dec 1, 2014 at 5:10am UTC
1. Which of the following is the constructor name of class Computer?
a. ComputerConstructor
b. Computer
c. ConstructorComputer
d. Constructor
I am totally not sure what this is even asking. Help me out please?
Dec 1, 2014 at 5:19am UTC
Constructors do not have names .
A special declarator syntax is used to declare or define the constructor. The syntax uses:
— an optional <elided>
— the constructor’s class name, and
— a parameter list
in that order - IS
1 2 3 4 5
struct Computer
{
Computer( /* ... */ ) ; // constructor (declaration)
// ...
};
Dec 1, 2014 at 5:20am UTC
So the constructor name is simply Computer in this case?
Dec 1, 2014 at 5:34am UTC
Computer is the name of the class. Constructors do not have names.
Bad question:
1 2 3 4 5
1. Which of the following is the constructor name of class Computer?
a. ComputerConstructor
b. Computer
c. ConstructorComputer
d. Constructor
Answer (if it must be answered):
None of the above. Constructors do not have names.
Topic archived. No new replies allowed.