In this tutorial, we will go through c introduction. Wou will learn about one of the most used and widely accepted language. That is C language. At first, we will cover the basic concepts, then, we will move towards some advance concepts of c. At the end of this series, you will get some questions to test how much you learned. Let’s start the tutorial now.
C Introduction
C is a general purpose high level language that was originally developed by Dennis M Ritchie, at Bell Labs between 1969 and 1973, for the UNIX operating system. C has become one of the most popular and widely used programming language. C has been standardised by the American National Standards Institute (ANSI) since 1989 and subsequently by International Organization for Standardisation(ISO).
Why C is popular?
Some of the main reasons are –
a. It’s easy to learn.
b. Size: Programmes written in c language is generally light weight.
c. Portability: C is oldest language which can be considered cross-platform. Although you would need to re-compile on the target platform. most c source runs exactly the same on any platform.
d. Longevity: Since c is very old language. It has largest collection of optimised libraries and source code extant.
e. Raw performance: Since c is very old language, it has been optimised to run efficiently even in device having low memory and space.
f. Relations with machine: C is very near to machine i.e. there are very less abstraction is c.
Usage of C language
C language is used for –
a. Operating system
b. Language compiler
c. Assembler
d. Editors
e. Network driver
f. Modern programming
g. Interpreters
h. Utilities
Many languages have used c language directly or indirectly. For example, C++, Rust, Java, Javascript, Limbo, C#, Objective c, PHP, Python, Swift, and Verilog. Most of the them have syntacticly similar to c language.
Setup Environment for C language
If you want to do programming in c, you would need to setup the environment first. Basically, you need Text Editor and C compiler.
In Text Editor, you write program. The code that you write in the file is source-code. Then, you need to save the file with .c extension. After that, you need c compiler to compile and execute it.
You can use any text editor. For example, Windows Notepad, OS Edit command, Brief, Epsilon, EMACS, and vim or vi.
Actually, whatever we write in the file is human readable, machine do not understand it. Machine needs instruction to perform the task we want him to do. Here comes the role of Compiler. Compiler compiles the source-code and converts into executable program. Machine understands the converted code. So, it takes action as per the instructions given in the converted code.
If you are on the Linux, you can use gcc. If you are using Mac OS, you can use Xcode to write and execute c program. If you are on windows, you can use Code::Blocks and MINGW.
Conclusion
In this part, we have given just brief c introduction. In the next lesson, we will learn about the c program structures.