1

Or do you have to manually create them? Was wondering if you can just create a class, declare some variables and method/functions. Then assign the object to your class in the int main function. Do you need to put in a constructor/deconstructor to create and destroy the memory that was used to hold to place of the variables or is there defaults that already do that? Any additional info on constructors and destructors would be nice. Don't need a lot just some simple added info to make understanding this easier. Not trying to create programs that promote memory leakage

Jcodin
  • 73
  • 5
  • 2
    You should probably pick up a good introductory book on C++ instead of asking questions about the basic workings of the language http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list – user657267 Apr 09 '14 at 04:04

1 Answers1

1

You do not need to explicitly provide a constructor/destructor as a default is generated for you. However, if you have any plain old data types, such as pointers to dynamically allocated memory, you will want to make certain that you provide your own manually specified destructor as the default will not be sufficient.

ppl
  • 1,120
  • 5
  • 18