> [ Picked text/plain from multipart/alternative ]
> Ive been working on using C in external dlls that are later
> loaded at runtime; and i have a question: While i need a
> function to "new" a class, do i need one for "delete" or can i
> just call delete ptr; like normal?
Are you talking about constructors and destructors?
A constructor has the same name as its class:
MyClass( ) { ... }
and a destructor is the same, but prefixed with ~:
~MyClass( ) { ... }
Destructors aren't usually necessary; the compiler will create
one automatically for you. (just like a class with no constructors will automatically
be given a constructor with no parameters.)
The main exception is when you're using virtual functions. If you declare any
functions virtual in a class, you should declare a virtual destructor in that class
too. Something like:
virtual ~MyClass() {}
--
Laurie Cheers
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders