answersLogoWhite

0

The first step is to install the XCode developer tools that comes with OSX. You can do this by looking on your OSX install disc. There should be a folder for optional installs, and a package for XCode. This will automatically install gcc, a C compiler, on your machine. Next, find the Console in the Utilities folder. It opens a UNIX shell. Move to the directory that your c file is in (you can find more information about UNIX elsewhere if you need to). Let's say your C file is named myfile.c. To compile it, type: gcc myfile.c This will compile your program, and name the compiled program a.out. To run it, type: ./a.out I hope that helps. Brina

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

How do you compile and run C plus plus programs on the Macintosh?

Use Xcode. See related links below.


What is a quick way to use Visual Studio.Net to compile and run a C?

You can write perfectly good C programs in C++. C programs are essentially just C++ programs that make use of the C standard libraries (and other libraries written for C) rather than making use of C++ standard libraries (and other libraries written for C++). However, non-trivial C programs are better written in C++ as the resultant code will generally be smaller and much more efficient, not to mention easier to manage.


Can you run programs compiled with Turbo C on Linux?

Turbo C cannot compile native Linux binaries, only programs for MS-DOS. MS-DOS applications can be run on Linux through a variety of methods, including DOSEMU, DOSBox, QEMU, Bochs, and VirtualBox.


What are the steps in c plus plus?

Code, compile, link, run.


Why the programs of C and java are compiled before execution?

Because the source programs just do not run. Full stop.You have to1) compile them to an executable (C)2) use a program that interprets them (script languages, eg. sh, perl, php)3) mix the two: half-compile them into something that can be interpreted by another program (source -> javac.exe -> bytecode -> java.exe)


How many compilers are there to compile a C program?

There are many C compilers. In modern usage, the most common ones are Microsoft Visual C++ (which can also compile C programs) and GCC (GNU Compiler Collecttion, originally GNU C Compiler).


CAn you work in c or c plus plus without editor?

You can compile, link and execute programs without text-editor.


What is statement terminator in c language?

The compiler demands it: your programs wouldn't compile without them.


Can you access c language in dos and unix?

You can write, compile and execute C-programs in both DOS and Unix, if that's what you meant.


What are the disadvantages of lengthier c plus plus computer programs?

The source files take a longer time to compile, and reading and maintaining such programs is harder.


Why wont your C plus plus programs compile?

C++ programs won't compile if they contain compiler errors. The compiler will tell you precisely where the error is, and the type of error, unless the error is in a macro. The compiler cannot see macro definitions because they are inline expanded prior to compilation.


Can c be used on dos- operating system or xenix operating system?

Yes. There are C compilers for MS-DOS and for Xenix. Santa Cruz Operation OpenServer can compile programs to run on Xenix. See http://williambader.com/museum/dell/xenixhistory.html