This lesson will give you a complete Introduction to C Programming. The C programming language is a MUST for students and working professionals to become a great Software Engineer especially when they are working in the Software Development Domain.
Brief Introduction to C Programming?
C is a general-purpose, procedural, machine-independent, structured programming language. It was created by Dennis M. Ritchie at the Bell Telephone Laboratories in 1972 for developing the UNIX operating system. C was derived from a language called B created by Ken Thompson. As it was a successor of Language B, hence the name C.
Contrary to popular belief, C is not a high-level language. It is a mid-level language with the simplicity of a high-level language but the power of a low-level language. Programs written in C are wicked fast. It is also a small language compared to others, with only 32 keywords. Keywords are reserved words used by a language for doing certain tasks. We will talk about them in detail, later in the course. Due to the small library of keywords, C can be learned easily.
After nearly four decades of its creation, C is still used to write everything from Operating Systems (Windows) to complex programs like the Oracle database, GIT, Python Interpreter and more. The whole world of Embedded Systems is still heavily reliant on C owing to its fast execution time in safety-critical real-time systems.
History of C Language
The development of the UNIX operating system is closely tied to the origin of C. UNIX was originally written in assembly language on a PDP-7 by Dennis M. Ritchie and Ken Thompson. Thompson wanted a programming language to make utility applications for the new platform. He tried to make a Fortran Compiler but soon gave up on that idea. Later he created a cut-down version of the recently developed BPCL systems Programming Language. This new language had no official description as of yet, and Thompson modified its syntax to be less wordy, producing a new similar but simpler language B. However, B was slow and only a few utilities were ever written on it.
Ritchie started to improve upon this new language created by his friend in 1972. This resulted in the creation of the new language C. Later the C Compiler and some utilities written in it were included in Version 2 of UNIX OS.
Brain Kernighan and Dennis Ritchie published the first edition of the “C Programming Language”, in 1978. This book, known as K&R, served for many years as the informal specification for this language.
ANSI C and ISO C
In the early 1980s, C was getting popular as some versions of it were implemented in mainframe computers, minicomputers and microcomputers including the IBM PC. Therefore, in 1983, the American National Standards Institute(ANSI) formed a committee, X3J11, to establish a standard specification of C. They based it on UNIX implementation and this version is widely known as ANSI C or C89. It is also called as simply C and taught in schools as the first Introduction to C Programming Language.
In 1990, the International Organization for Standardization adopted the ANSI standard as ISO/IEC 9899:1990, which is sometimes called C90. Therefore, the terms C89 and C90 refer to the same programming language.
The C standard was further revised in the late 1990s, leading to the publication of ISO/IEC 9899:1999 in 1999, which is commonly referred to as C99.
There was another revision of the standard C language in 2007 which was informally called C1X. It was officially published in 2011 and called C11.
This version is the current C standard and it was published in 2018. It introduced no new language features, only technical corrections and clarifications to the shortcomings in C11.
Embedded C Programming requires some nonstandard extensions of the current C language to support features such as fixed and floating-point arithmetic, I/O Operations, multiple memory bank operations etc. In 2008, the C standards committee released a technical report which extended the C language to include these features and create a common standard for Embedded C.
Where is C Language used?
- Linux OS, Apple’s OS X and Windows have been written in C. Other Operating Systems such as Symbian for mobile OS, is also written in C.
- Web Developing Tools such as PHP has been written in C.
- C is widely used in Embedded Systems due to its fast execution time.
- It is also used to develop system and desktop applications.
- Most of the applications by Adobe such as Photoshop and After-Effects are developed using the C programming language.
- It is also used to develop databases. MySQL, for example, is the most popular database software which is built using C.
- C is also used for developing browsers and their extensions. Google’s Chromium is built using the C programming language.
- C is used for producing Compilers for other Programming Languages.
- C is now widely used in IoT applications.
All these applications in a wide range of fields make it one of the most widely used languages today. In fact, in 2019, C was the third most widely used language even after almost 40 years of its creation. Not bad…!
Introduction to C Programming Language Features
C is a Compiled Language
A compiler is a piece of software or program that converts high/mid-level language to machine level language (1 and 0). In a compiled language such as C, this piece of software will convert the entire code at once before execution. In comparison, an Interpreter based language such as Python converts one line of code at a time and executed it.
Efficiency of C
C is very efficient in terms of memory management and is very fast. It was designed for UNIX OS, so it was essential for a C program to run quickly and with a limited amount of memory.
Portability of C Programs
Code written in C is extremely Portable. What this means is, a program written in C can run in a wide variety of operating systems with little or no modifications.
Even after almost forty years since its creation, this language is still used to write Operating Systems, and create compilers and interpreters for other Programming Languages such as Python, Perl, PHP, BASIC etc.
This concludes the first lesson “Introduction to C Programming”. Hope you found it useful. Feel free to share this course using the sharing buttons below and do Enrol if you haven’t already. In the next lesson, we will learn to install the Codeblocks IDE.