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
simple coding for pebble merchant..

i need amibroker afl to dll plugin

what is the difference between call by reference and call by pointer method?

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

Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code

1. write a program named InputMethodDemo2 that eliminates the repetitive code in the InputMethod() in the InputMethodDemo program. Rewrite the program so the InputMethod()contains

write a program that counts the number of occurrences of the string in the n-th Padovan string P(n)   program in java // aakash , suraj , prem sasi kumar kamaraj college

MAT LAB programming Project Description: Just for who are PROFESSIONAL IN MATLAB i have simulation and i would like to simulate the equation in ,and test the all simulatio

i want write visuaL c++ FOR MY ALGORITHM

Passing and Returning Objects Objects can be passed to a function and returned back just like normal variables. When an object is passed by content, the compiler makes another