#1 Introduction To C Language #1 Introduction To C Language
#1 Introduction To C Language #1 Introduction To C Language
www.mysirg.com
#1 Introduction to C Language
By Saurabh Shukla | 2017©mysirg.com
C language is very popular among programmers for its unique features and capabilities. Let’s first
have a look to its fame.
These are some of the points to make you understand that C is not an outdated language. Many
students have this myth, they believe that C is out of industry, but it is not. C is more popular in
system level programming, hardware interaction, embedded systems and building core libraries of
android.
www.mysirg.com
History of C Language
BCPL (Basic Combined Programming Language) was developed by Martin Richards in 1966
Taking inspiration from BCPL, Ken Thompson has developed B language in 1969. Objective
was to create UNIX operating system.
Dennis Ritchie developed C language by making improvements in B language in 1972 at AT &
T’s Bell Laboratory, New Jersy, USA.
UNIX was rewritten in C language. Ritchie and Thompson are co-developers of UNIX.
Computer
Computer is an electronic device which takes input, process it and gives output.
What is 0 and 1?
There is nothing like 0 and 1 in computer. There is no physical signif icance of 0 and 1.
We can encode any information in the form of 0s and 1s. Whether it is an audio, text, video or
images, we can convert them into series of 0s and 1s.
Computer hardware constitutes of many kind of memory devices to store information. Such m emory
devices are Hard Drive, flash memory, RAM, CPU registers, etc. Memory devices differ in
technologies, but all have this common capability to store information.
Hard drive can store magnetic information in two states (North Pole upside or downside), RAM has
capacitors to store information in two states (charge in the capacitor is present or absent), CPU
registers or processor registers can also store information in two states (low volt and high volt).
We can encode any information in the form of 0s and 1s. Whether it is an audio, text, video or
images, we can convert them into series of 0s and 1s.
Any real world information in encoded form (0s and 1s) can be stored in computer memory devices.
As all memory devices can maintain two state of information, we can easily map one state with 0
and another state with 1.
Hardware
#1 Introduction to C Language
C Notes Vol-1 by Saurabh Shukla
www.mysirg.com
Hardware is a comprehensive term for all of the physical parts of a computer, as distinguished from
the data it contains or operates on, and the software that provides instructions for the hardware to
accomplish tasks.
File
Data is stored in your computer, generally in hard drive. It is stored in files. You must have seen files
in your computer. They are audio files, video files, text files, image files, etc.
Every file has a name and extension. For example, Track01.mp3 is a file, where Track01 is name of
the file and mp3 is extension of the file.
File is a data bundle. Kind of data stored in the file can be interpreted by looking at file extension.
Like mp3 is for audio, jpg is for image, txt is for text, etc.
All file contains 0s and 1s, but there decoding depends on the file extension. So the same sequence
of 0s and 1s can be interpreted in multiple ways. If it is stored in some text file then it is decoded as
some character.
Now you can observe files with the extensions exe. These are special files. Data in exe file, are
instructions for the computer to perform a task. Exe file or executable file is software.
Software
Software is an executable file (Extension exe is windows operating system specific, for other OS
extension may differ).
System software is for computer system, they might be software responsible to control har dware or
any background task. Like software responsible for graphics is system software.
Application software is for the users. It is developed to solve human problems. Like MS word is
application software.
Program
Operating system
OS is system software. Windows 8, Windows XP, Windows 10, Ubuntu, RedHat, Solaris, Macintosh,
etc are all examples of operating system.
#1 Introduction to C Language
C Notes Vol-1 by Saurabh Shukla
www.mysirg.com
Operating system is essential software in your computer responsible to manage all resources
(hardware and software), running programs, memory management, file management, security and
interaction with user.
Execution of a program
Your program or software is an exe file stored somewhere in your hard drive. You double click on it
to execute program.
Software Development in C
#1 Introduction to C Language
C Notes Vol-1 by Saurabh Shukla
www.mysirg.com
We want to make software that is an exe file. Executable file is machine dependent coding. It is hard
to remember machine codes. Thus creating exe file by typing machine code is hell lot of task. S o we
prefer to write code in comparatively simple language called C language and then convert C
language code into machine code using some software (translator).
Create a file with name of your choice but extension must be .c, this file is k nown as source
file.
Sometimes you added statements in your program which are required to preprocess ( You
will learn about them later). Such statements are handled by a program called Preprocessor.
Preprocessor generate a file for the compiler
Compiler then translates your code into m achine code. Compiler may generate error if your
code is not written according to the rules. A code with no error is successfully compiled and
saved with extension .o or .obj, this file is known as object file.
Linker software then links your object file with the library code (library code resides in library
files), and as a result yield an executable file (extension .exe) , which you call your developed
software
References:
www.mysirg.com
o https://www.youtube.com/watch?v=__JKmT5EFb8&feature=youtu.be&list=PL7
ersPsTyYt2Q-SqZxTA1D-melSfqBRMW
Lecture 1 Introduction to C language part 3
o https://www.youtube.com/watch?v=92HLfZHH814&feature=youtu.be&list=PL7
ersPsTyYt2Q-SqZxTA1D-melSfqBRMW
Exercise