Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a simple question about constructor

Status
Not open for further replies.

jayjay60

Programmer
Jun 19, 2001
97
FR
Perhaps i have a problem with my brain, but i would like to know if the a default constructor must do sthing. I explain what i mean.
In my application, i have created a class where of course there is a constructor, mine is a default constructor. I don't need to create an object which will be initialize to something, i just want to have some methods which do calculations..., so in my code .cpp, i put nothing between curly brace for the definition of the constructor. Is it good or not?

thanks in advance

jayjay
 
Perfectly fine. Lots of times, the default constructor will suffice.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top