Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Palad1

macrumors 6502a
Feb 24, 2004
647
0
London, UK
Let's recap things:

1/ A file contains source code and is run through a compiler, it its turned into an object file.
2/ Several files are then linked together and create binaries (or executables)

So, if you get a source file containing c++, compile it with a c++ toolchain, then link it, you get an executable file.

If you take a source file containning obj-c code, compile it with an obj-c toolchain, link it, you get an executable file.

Both executables can be run, without any consideration about the original language.

What makes a big difference are the API (external libraries) used. Most C / C++ libraries can be called from a variety of language (perl/php/obj-C). On the other hand, most Obj-C libraries cannot be called from external languages without running through some serious hoops...

If you want to write portable obj-c code (ie. between Mac OS X and Linux) you should be careful not to use cocoa for example.

Hope that helps ...

ps: good luck with your linked list and your overflowing buffers, we all went though this at some point ;)
 

GeeYouEye

macrumors 68000
Dec 9, 2001
1,669
10
State of Denial
Having programmed in both Objective-C and C++ for a 2-3 years each now, I've found that Objective-C is much more consistent, less headachy, and far easier to debug. I used to hate the idea of having no objects on the stack in Objective-C, for example, but when that's the case, everything gets treated the same. Also means you don't need a no-argument constructor if you ever want to use a class in a composition class. And then there's templates... *shudder*
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.