Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Programming C on Mac

  • 08-02-2009 1:19pm
    #1
    Registered Users, Registered Users 2 Posts: 2,708 ✭✭✭


    I've done a bit of Java before and am interested in learning to program in C. I was hoping someone could point me in the direction of a decent program to learn C using the Mac Leopard OS. If anyone knows of any particularly good tutorials that would be great too, but I'm sure there loads out there.

    Appreciate any help.


Comments

  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    gcc is installed by default on macs i'm pretty sure.

    type this in a terminal window

    $ which gcc

    if you get back something like (the path i've given may not be exact)
    /usr/bin/gcc

    then all you have to do to compile is:

    $ gcc -Wall -o myCprog myCprog.c
    $ ./myCprog


  • Registered Users, Registered Users 2 Posts: 2,708 ✭✭✭ScissorPaperRock


    Thanks Creamy!


  • Registered Users, Registered Users 2 Posts: 46 Heinlein


    MacOS X comes with a nice IDE called XCode, you can find it on one of the CDs that came with your Mac. XCode supports many languages, including C, C++ and Objective C. The IDE is probably not as nice as Visual Studio and Eclipse, but still pretty much usable.


  • Registered Users, Registered Users 2 Posts: 39 Talon.ie


    You could also use Eclipse on OS X.

    The CDT plugin works very well for developing C / C++. It even integrates with GCC, so you'll be able to do proper debugging from right inside the IDE.

    You can get it here http://www.eclipse.org/downloads/


  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    i'd be of the different opinion.

    Xcode's UI and UI experience is far greater than visual studio and defintely eclipse.

    eclipse imo is pants, i try to avoid it at all costs.

    and as the OP is just starting out with C i think it would be beneficial from him/her to learn the compiling process from the terminal and when familiar with that, move to an IDE. IDE are pretty pointless for like one program compiles, you'll waste more time setting up a project/build paths etc.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 46 Heinlein


    Talon.ie wrote: »
    You could also use Eclipse on OS X.

    Beware though, it's terribly slow and buggy as well. Eclipse is pretty nice if you can live with its slowness, sudden crashes and corrupted project files ;)


  • Registered Users, Registered Users 2 Posts: 46 Heinlein


    Xcode's UI and UI experience is far greater than visual studio and defintely eclipse.

    Depends on what functionality you are using when coding and debugging. Some of the things used frequently in VS that I missed in XCode very much:

    * smarter code completion, only objects relevant to the context are listed, not everything like in XCode. E.g. you type an object name and a dot and you get only members of the class listed in VS.

    * modify variables during debugging

    * CPU register/assembly interface in XCode is counter-intuitive and incomplete

    * Jump to symbol definition and back - XCode fails to do this properly more often than VS

    * overall the compilation and debugging in XCode is slower, I'd say in orders of magnitude, because XCode uses external command line tools

    Probably forgot to mention a few other things.


Advertisement