C guide to start coding (Part 1).
A tutorial for new programmers.
C Language Overview
This chapter describes the basic details about C programming language, how it emerged, what are strengths of C and why we should use C.
The C programming language is a general-purpose, mid to high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC PDP-11 computer in 1972. In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard. The UNIX operating system, the C compiler, and essentially all UNIX applications programs have been written in C. The C has now become a widely used professional language for various reasons.
1.Easy to learn
2.Structured language
3.It produces efficient programs.
4.It can handle low-level activities.
5.It can be compiled on a variety of computer platforms.
Why to use C?
C was used for system development work, in particular the programs that make up the operating system.Some examples of the use of C might be:
-Operating Systems
-Language Compilers
-Text Editors
-Print Spoolers
-Network Drivers
-Modern Programs
-Databases
-Utilities
How to set up your computer to start coding
The C Compiler
The source code written in source file is the human readable source for your program. It needs to be “compiled”, to turn into machine language so that your CPU can actually execute the program as per instructions given. This C programming language compiler will be used to compile your source code into final executable program. Most frequently used and free available compiler is GNU C/C++ compiler, otherwise a great one is CodeBlocks.Codeblocks is perfect for new programmers using C/C++ .Following section guides you on how to install GNU C/C++ compiler and Codeblocks on various OS. I’m mentioning C/C++ together because GNU gcc compiler and Codeblocks works for both C and C++ programming languages.
Installation on UNIX/Linux
If you are using Linux or UNIX, then check whether GCC is installed on your system by entering the following command from the command line:
If you have GNU compiler installed on your machine, then it should print a message something as follows:
Installation on Mac OS
If you use Mac OS X, the easiest way to obtain GCC is to download the Xcode development environment from Apple’s web site and follow the simple installation instructions. Once you have Xcode setup, you will be able to use GNU compiler for C/C++. Xcode is currently available at developer.apple.com/technologies/tools/.
Installation on Windows
GNU COMPILER
To install GCC at Windows you need to install MinGW. To install MinGW, go to the MinGW homepage, www.mingw.org, and follow the link to the MinGW download page. Download the latest version of the MinGW installation program, which should be named MinGW- .exe. While installing MinWG, at a minimum, you must install gcc-core, gcc-g++, binutils, and the MinGW runtime, but you may wish to install more. Add the bin subdirectory of your MinGW installation to your PATH environment variable, so that you can specify these tools on the command line by their simple names. When the installation is complete, you will be able to run gcc, g++, ar, ranlib, dlltool, and several other GNU tools from the Windows command line.
Codeblocks
To install Codeblocks at Windows you need to go to the Codeblocks website and click the “Download the binary release” then select Windows XP / Vista / 7 / 8.x / 10
This is everything you need to start coding with C language!