Setting up Your Environment

To write programs you will need a development environment. This section will show you how to set one up.

To write a program you will need 2 things. A text editor and a compiler. That's it. You can choose to use an integrated development environment (IDE) if you like. However, to keep it simple for this book, we will be using just a compiler and a text editor.

C compilers exists on many different platforms. However, you may need to download the appropriate tool for your specific platform.

Text editor (code editor)

A text editor is a program that lets you type in text. Every operating system typically include some way of creating text. However, they may not suit your needs.

Note that word processors such as MS word are NOT text editors. The files that they produce not only contain the text that you type but also include formatting instructions. A text editor for coding should only store the text that you write. It is worth the time to investigate different text editors and find one that you like. It is the tool that you will use most so you need to be comfortable with it.

Below lists a few options for text editors. You can try out what works for you. These are not endorsements, just resources for you to consider

Compilers

Linux

On Linux, compilers are typically installed. To test if you have a compiler open up a console and type:

gcc

OSX

On OSX, you can get command line compilers for free. First you may need to get xcode from the app store. Once you have installed it, you should also have all the command line tools. Open up a terminal (Applications --> utility --> terminal) and type:

clang

If your tools are not installed it will install them.

Windows

On Windows, you should get and install visual studio. You can get visual studio express here:

visual studio express

Last updated