Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

sepples

Name: Anonymous 2009-01-19 18:16

Hey /prog/
I never really used C or C++ before, other than when I started learning programming. I want to do something in one of them, (maybe an OS lol) but I'm not very confident about allocating/freeing up memory (I haven't done it before often).
Just to refresh my memory, as long as I use malloc and free with C and new and delete keywords with C++ I'm safe, right? And can I use malloc and free in C++ too?

Also, discuss Objective-C and the Sepplesox I heard about before.

Name: Anonymous 2009-01-19 18:22

malloc and free can be used in both C++ and C, but new and delete are only for C++. If you're working with objects, you need to use new/delete so that constructors and destructors are called. Just be sure you don't delete a malloc'd region, and vice versa for free/new.

C++0x is the next revision of the C++ standard. The standard will include "C++ Technical Report 1 (TR1)", which is a set of class additions to the library. Additionally, the standard aims to improve multithreading support and adds some weird operator (&&), which you'll most likely never use.

Objective-C is weird

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List