Thread: Help with the "C" command

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    3

    Question Help with the "C" command

    Hey,
    (ok first post....repetitive questions....just shoot me!)

    This question is probably asked around 4 gzillion times, but well let me make that 4 gzillion and one.

    Alright i've borrowed my friend's "C for dummies" and going through the first chapter. I run on a OS X and use Xcode for some odd reason.

    So the book asks me to save something with .c extension then compile/link and then run.....now im confused!

    is Xcode both the text writer for source code AND the complier/link AND the run/tester ?

    and in that book they've skipped the part that i turn the coding into an actual app ( what extension in the first place?!). Regarding the actual running, (on windows at least) it talks about prompting the .c file with DOS i think, can Terminal on OS X do the same? i only use terminal for fancy navigation and move/add/copy/delete just for fun.


    I'll be happy to get some help here

  2. #2
    Registered User
    Join Date
    Feb 2011
    Posts
    3
    i just solved all of the problems, Xcode basically does everything and the prompting and running is via terminal

    [SOLVED]


  3. #3
    Novice
    Join Date
    Jul 2009
    Posts
    568
    XCode is an IDE. Basically a text editor with extensions that make it particularly well suited for developing software. It is possible for the IDE to be integrated with the compiler (you get a single point of interaction) but they are distinct pieces of software.

    If you were working w/o an IDE, the steps for creating a simple executable would be as follows:
    (1) Write the source in a text editor and save it with a .c extension, f.ex as myprog.c;
    (2) Compile it from the Terminal, most likely using GCC as I believe that is the default compiler on MacOS, with the command: "gcc myprog.c". This will create an executable called a.out;
    (3) Run the executable by typing "./a.out" at the Terminal.

    In an IDE, I would expect that the menu item that would perform compilation is called "Build".
    Disclaimer: This post shows my ignorance at the time of its making. I claim ownership of but not responsibility for all errors in it. Reference at your own peril.

  4. #4
    Registered User
    Join Date
    Feb 2011
    Posts
    3
    Quote Originally Posted by msh View Post
    XCode is an IDE. Basically a text editor with extensions that make it particularly well suited for developing software. It is possible for the IDE to be integrated with the compiler (you get a single point of interaction) but they are distinct pieces of software.

    If you were working w/o an IDE, the steps for creating a simple executable would be as follows:
    (1) Write the source in a text editor and save it with a .c extension, f.ex as myprog.c;
    (2) Compile it from the Terminal, most likely using GCC as I believe that is the default compiler on MacOS, with the command: "gcc myprog.c". This will create an executable called a.out;
    (3) Run the executable by typing "./a.out" at the Terminal.

    In an IDE, I would expect that the menu item that would perform compilation is called "Build".
    I partly understand but still thank you for the reply, i'll have to do more research on this

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 07-05-2010, 10:43 AM
  2. c program that accepts and executes commands?
    By Cimposter in forum C Programming
    Replies: 3
    Last Post: 09-30-2009, 02:58 PM
  3. List of Command
    By Peter_APIIT in forum C++ Programming
    Replies: 0
    Last Post: 08-08-2009, 09:47 PM
  4. problem with "touch" command in c program
    By Moony in forum C Programming
    Replies: 10
    Last Post: 08-01-2006, 09:56 AM
  5. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM

Tags for this Thread