# C/C++ programming



## MadDoc (Sep 4, 2004)

OK, I have been using RealBASIC for over a year now and have experience with VB and some (older) procedural BASIC variants (e.g. MetalBASIC) but I would like to learn to program in a 'C' language (as this will help me with my ultimate, longterm goal of writing a BASIC compiler).

I have been surfing the net for a few days trying to figure out the difference between C and C++, which one to learn, etc. I think I want to learn C++, simply as it seems the most 'popular' and prolific. 

What is objective-C? I have Xcode (which as its free) seems a good place to start to learn a C language. However, it seems that I can't use Xcode to write C++ programs, at least not without knowing some C!

My question is this. Since I am not new to programming, and I have experience with OOP (VB, RB) - what C 'variant' is my best bet to learn? Also, what IDE should/can I use and where is a good place to start. I am a hobbyist programmer (medic by nature).

I don't even understand the difference between Cocoa and Carbon! It seems very overwhelming! RB is so simple as you type your program click build and it works. Is this the same when you write a program in C?

I'd really appreciate people's help/advice.

MadDoc,


----------



## chevy (Sep 4, 2004)

double


----------



## chevy (Sep 4, 2004)

Try http://developer.apple.com/macosx/



> Carbon
> Carbon is a set of procedural C APIs for developing full-featured, high-performance, highly reliable applications for Mac OS X.The Carbon API set is based on earlier Macintosh APIs, but expanded and enhanced to take advantage of the power of  Mac OS X.
> 
> Cocoa
> Cocoa is a rich object-oriented framework designed specifically for developing  Mac OS X-only native applications.When coupled with Interface Builder, Apples interface design tool, developers can create full-featured, object-oriented applications on Mac OS X in a fraction of the time they would need using procedural languages. Developers coming from UNIX and other OS platforms often use Cocoa to a build state-of-the-art Aqua user interface on top of a core of portable, platform-agnostic code.


----------



## Viro (Sep 4, 2004)

I would say go with C++. It's a much more supported language and Objective-C in that it is the primary language of Windows, Linux and possibly othe OSes. Objective-C on the other hand is mainly supported by Apple.

RB and VB don't really support OO programming. You might find things a little difficult at first, but just stick with it. I've found the Deitel&Deitel books on C++ quite good for learning C++.

C is a nice language that is (mostly) a subset of C++. It isn't necessary to know C before moving to C++. On the contrary, you might pick up bad habits in C that you will have to unlearn when you move to C++. 

So in short, go with C++.


----------



## MadDoc (Sep 4, 2004)

Thanks Viro,
So I can program in C++ using XCode as the IDE? How?


----------



## chevy (Sep 4, 2004)

http://developer.apple.com/referencelibrary/GettingStarted/GS_MacOSX/index.html


----------

