Thread: errors in my class....

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    "would I need to use a deconstructor? I am assuming that a constructer gives you acces to those functions and the deconstructer stops giving acces?"

    A constructor is called when you declare any object. Usually, you'll define the constructor to intialize your member variables like I did with the code in my previous post.

    A destructor is automatically called when your object goes out of scope or the program ends. Unless you need to do something special, like delete dynamically created memory or close open phone lines your object was using, you don't need to define a destructor youself--the default destructor will be called automatically.

    You should probably read a basic tutorial on classes before you attempt to write programs with them.
    Last edited by 7stud; 04-14-2003 at 03:25 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Default class template problem
    By Elysia in forum C++ Programming
    Replies: 5
    Last Post: 07-11-2008, 08:44 AM
  2. Replies: 8
    Last Post: 10-02-2005, 12:27 AM
  3. Class Errors (LNK2005)
    By NMZ in forum C++ Programming
    Replies: 4
    Last Post: 02-28-2005, 03:52 PM
  4. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM
  5. class member access denied
    By chiqui in forum C++ Programming
    Replies: 2
    Last Post: 05-27-2002, 02:02 PM