Latest web development tutorials

C environment settings

Local environment settings

If you want to set the C language environment, you need to ensure that the following two available software, text editor and a C compiler on your computer.

text editor

This will be used to enter your program. Text editor including Windows Notepad, OS Edit command, Brief, Epsilon, EMACS and vim / vi.

The name and version of the text editor on different operating systems may differ. For example, Notepad is typically used on Windows operating systems, vim / vi can be used on Windows and Linux / UNIX operating systems.

Files created by editors often called the source file, the source file that contains the source code. C program source files typically use the extension".c".

Before starting the program, make sure you have a text editor, and have enough experience to write a computer program, and then save it in a file, compile and execute it.

C Compiler

Written in the source file in the source code is human readable source. It requires "translated" into machine language so that the CPU can execute the program according to the given instructions.

C language compiler is used to compile the source code into executable programs. This assumes you already have a basic understanding of the programming language compiler.

The most popular free compiler is available in the GNU C / C ++ compiler, if you are using an HP or Solaris, you can use the compiler on each operating system.

The following section will guide you how to install the GNU operating system on a different C / C ++ compiler. Here also mentioned C / C ++, mainly because GNU gcc compiler suitable for C and C ++ programming languages.

Install UNIX / Linux on

If you are using aLinux or UNIX, at the command line using the following command to check if your system is installed on the GCC:

$ gcc -v

If your computer has installed the GNU compiler, the following message appears:

Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr .......
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)

If GCC is not installed, then follow http://gcc.gnu.org/install/ install GCC detailed instructions on.

This tutorial is based on Linux written in any given instance are compiled on Cent OS Linux systems too.

Installation on Mac OS

If you're using Mac OS X, the most efficient way to get the GCC is to download the Xcode development environment from Apple's Web site and follow the installation instructions. Once installed Xcode, you can use the GNU compiler.

Xcode is currently available from developer.apple.com/technologies/tools/ download.

Installation on Windows

To install GCC on Windows, you need to install MinGW. To install MinGW, MinGW visit the homepage www.mingw.org , enter the MinGW download page and download the latest version of MinGW installer, named format MinGW- <version> .exe.

When installing MinWG, that you at least want to install gcc-core, gcc-g ++, binutils and MinGW runtime, but generally will install more other items.

Add your installed MinGW bin subdirectory in yourPATH environment variable, so you can simply name on the command line to specify these tools.

When the installation is complete, you can run gcc, g ++, ar, ranlib, dlltool and several other GNU tools from the Windows command line.