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
print this pattern 1 01 101 0101

Use the program called harris-shell.c and add some code to find the corners in the image checkers.jpg. You should say that a pixel in the image is a corner if it passes the given t

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The value of b[-1] is


programing code on board coloring in clanguage

program area under the curve y=f(x) between x=a & y=b, integrate y=f(x) between the limits of a & b   Solution: #include float    start_point,            /* GLOBAL V

How to write a function template A function template should be written at the beginning of the program in the global area, or you may place it into a header file. All function

Ask queCreate an object oriented application with C# that computes the area of a rectangle, and the area and the volume of a cuboid. Based on the inheritance concept, create a bas