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
Description: Create a program that allows the user to track the hours an employee worked in a week. How much the employee was paid and any extra hours worked (overtime pay).

Explain string constants in c language - Escape Sequences? Illustrations are "945", "hello", "well done", "5+3". The character constant (example 'x') isn't equivalent to the st

In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color. Fill the other elements in the board, suc



Node *orderedInsert(Node *p, int newval); /* Allocates a new Node with data value newval and inserts into the ordered list with first node pointer p in such a way that the data va

Project Description: Need someone to prepare a trading platform and sophisticated trading strategy. Must have knowledge and experience in most of these: QuickFIX, Esper, Quan


WHAT IS A C LANGUAGE? C IS A PROGRAMMING?