1. Home
  2. Computing & Technology
  3. C / C++ / C#

Definition of Constructor

By David Bolton, About.com

Definition: A constructor is a class member function in C++ and C# that has the same name as the class itself.

The purpose of the constructor is to initialize all member variables when an object of this class is created. Any resources acquired such as memory or open files are typically released in the class destructor.

Glossary:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Explore C / C++ / C#
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. C / C++ / C#

©2009 About.com, a part of The New York Times Company.

All rights reserved.