Is always the default constructor for fred fred::fred()?, C/C++ Programming

Is always the default constructor for Fred Fred::Fred()?

Posted Date: 3/15/2013 5:56:54 AM | Location : United States





Is always the default constructor for Fred Fred::Fred()?

A: No. A "default constructor" is a constructor which can be called with no arguments. One instance of this is a constructor that takes no parameters:

class Fred {            

public:

Fred(); // Default constructor: can be called with no args

...

};

Another instance of a "default constructor" is one which can take arguments, provided they are given default values:

class Fred {

public:

Fred(int i=3, int j=5); // Default constructor: can be called with no args

...

};

 

Posted by | Posted Date: 3/15/2013 5:57:33 AM


Related Discussions:- Is always the default constructor for fred fred::fred()?, Assignment Help, Ask Question on Is always the default constructor for fred fred::fred()?, Get Answer, Expert's Help, Is always the default constructor for fred fred::fred()? Discussions

Write discussion on Is always the default constructor for fred fred::fred()?
Your posts are moderated
Related Questions
algorithm to find out all the factors of given positive integers

i need a program for finding the last fibonacci number

Define register with bit fields? We could define register simply with bit fields: struct DISK_REGISTER { unsigned ready:1; unsigned error_occured:1; unsigned disk_spinni

Project Description: I have a barber salon I am seeking someone to build me software for my PARTNER PT6910 touch screen till system. This software must add multiple staff login

Scope Rules and Storage Classes The storage class verifies the life of a variable in terms of its duration or its scope. There are four storage classes : automatic static


recsection method source code for searching position

to compute the net pay of an emplyee, given his/her pay rate, number of hours and tax rate

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

Write a program that writes your name on the monitor ten times. Write this program three times, once with each looping method.