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
Define Array of Structures? An Array of Structures is an assortment of the same data types which are declared as structures. It is useful to store large and different number of

Operation on list - c++ program: Write a program in c to Insert value on list and list iteration. typedef struct item *node_ptr; struct item {                   int e

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Write a sequence of instructions that transfers data from memory to an external I/O device by using channel 3 of the 8237 DMA controller. Transfer from 20000H-20FFFH.

I would like to get you to collaborate in my project. We want a C programmer to Develop applications for Windows, the first application may be an Instant messenger encrypted in a w

C++ Programming Assignment ATM Machine Phase 1 In this assignment you will create a program that allows a user to do the following: 1) Create a bank account by supplying a use


#include stdio.h> #include conio.h> #include string.h> void main() {           int i=0,j=0,k=0,l=0;           int a[3][3],temp[3][3];           clrscr();

I want to take 1.1 as input but when I am declaring it as float the output is given as 1.1000000

C Program to check FACTORIAL   main() {             int i,j,m,fact,sum=0;           clrscr();           printf("ENTER THE NO.: ");           scanf("%d",&m);