learning C on mac

Posted:
in Mac Software edited January 2014
Hi, I am learning C/C++ currently, but is there any C complier for mac? Xcode is great, but just too much for a C beginer. I know i can use gcc through Terminal. But is that any available software that is simple and frendly?

Comments

  • Reply 1 of 5
    gongon Posts: 2,437member
    Quote:
    Originally Posted by iChina


    Hi, I am learning C/C++ currently, but is there any C complier for mac? Xcode is great, but just too much for a C beginer. I know i can use gcc through Terminal. But is that any available software that is simple and frendly?



    There are three tasks to take care of here.

    1) Writing the code.

    2) Compiling the code.

    3) Running the code.



    As long as you are an absolute beginner and do not have multiple files of code, you can write your code with any text editor (even TextEdit), compile it with gcc (one command) and run (one command) from the Terminal. Not too bad.



    It would help if you picked a better text editor right from the start. The key feature which TextEdit doesn't have and that really helps is syntax highlighting. I like Vim but do not recommend it to you - too much trouble to learn. SubEthaEdit is well liked and you can get it free from

    http://www.codingmonkeys.de/subethaedit/old.html



    Later on the compilation phase gets more complicated as you have more files which depend on each other. Also you'd typically like to combine 2) and 3) into one command. For these things, you can do one of two things: use an integrated development environment like XCode, or learn a tool called make, which can take care of the compliation for you. XCode is the easy way. It has more functionality such as debugging which can become useful later on if you do larger projects, but until you need it, just ignore it.
  • Reply 2 of 5
    I actually still recommend Xcode. It's a lot easier than bothering with the command line, and you'll grow out of C pretty quickly.



    When creating a new project, choose "Standard Tool" for C or "C++ Tool" for C++, and it sets everything up for you nicely. To build, just hit "Run" and you're set.
  • Reply 3 of 5
    Quote:
    Originally Posted by gregmightdothat


    I actually still recommend Xcode. It's a lot easier than bothering with the command line, and you'll grow out of C pretty quickly.



    When creating a new project, choose "Standard Tool" for C or "C++ Tool" for C++, and it sets everything up for you nicely. To build, just hit "Run" and you're set.



    Man now that I know how easy it is with XCode I think I'm going to have to get a book on C...
  • Reply 4 of 5
    dave k.dave k. Posts: 1,306member
    Check out these books:



    http://www.spiderworks.com/topics/macprogramming.php



    Good luck.



    Dave
  • Reply 5 of 5
    thanks to all you guys. i will try all the stuff.
Sign In or Register to comment.