Introduction to C
Introduction to C
C-Lamguage
Denhis Nitchie aud Ken Thompsen at
-
1972 1943.
citlen in C by
the Unix Kernel wan
-
Most o )establisheed
Stcudads Instikte
ANSI(Americau National
-B1969 mnce theu it is
called
C laupeaje
aud
staudancn fo
Called an C89).
an
ANSt-C (albe Cvaainadio)-fwdhan
staudardo
C99.
Loodig te
1 9 9 9 , T S o ( I n t e n n a t i o n a l
Tn nes featwn
acded
evised Caud pogammia
dor Sttem
deiqued maùn
Though it
coan prammiug
uned fr all tbt
cwvdutly beig
it is
Featw C laugnge
Keycoeds in
a
32 keyoerd.
Key«aad-Cha e tak u h lausua
O Fece a pedeinad
is amigned dont thougha
CDed # a t u C is
O a i e n t e d - E v e y t h i n g
usitha
execuutien
Fnctien itp
Bogram i t e begim pogam
i
onten as a
huction. Entive
Called
main".
cemplen
puosidoo noady
uciom C
uctiour.
Evey 1ho hammey
s fuction.
collecien
Caled a
bult-In
made suctiem fuuchieur
unt-dejnacd
CTeate
CO
u ane
Tis allois pioqaUm to divida
Stuctwud Lauuage bamc Cenctrel
iuto modults aud puouidts al
pogc suoiteh-stedeweta
stucues üke i, forlsop, cil-loop,
17 meaus Capital l o t l e
Coneeuihive.
Sentive-C u
Cae
mall ictten.
an diffexut fom a
the dhta-yhe
We cau chauye
6Weaklyyhedtarpuage Qud vice vea
itegfto float
the pucgaum. dem
þerforma
may
oheatoaa,tohich
operatorkChan
Rich u
t - , / , * ekt
Nnglt speatioua like
declae away olo olemests
We
aud ever prone
mas
doso.
Liberal C allois un to
l1h elcmsut of t .
aud accen
Editem + Compilon
Develepmtuct Enthervneut)
=
IDE CTtegaded
CodeBlocka gco-setu)
Rum
Stuctneo a Coqam
tion
Include headen filo sec
Global eclanations
main C)
x Commeut x/
Local declanatiown
Statemeds
exteuion.
a .h
Loraue
is Con v e t e d
te Cbject fila
Sowce Coda fila
Gbiect FL- exfeuien is ".o'.
Cemhilon,
vanious okject
linken inks the
HA
file-The execuetabl fila coith
Execukablo
a hinay
tile to produce
extewien exe".
cecutakle
byect Linken fil
Senee (Comiln
Libat
filen
Subplied oith Compilon.
ana net executed cenhi0.
by
cemilo the
m m e x t s - Commeuds
Blok cemmet
i s ued to
Cemmeut muHpto
Statemety */
screen.
a message en he
I/Program Je displaj edto
incuda te
Cetetsheadanf
include
<stdio.h>
usith main fuehion
# exeutien
twds aud euel
Pregam
main
>
>douni Opsio
osh
te C Language)
biace ("Welcema
print
S steudaxd funetie
Chmacten Coustauts)
(Backslanh
Escahe Sequence a c h n a c t e . This
\Cbackslash) aud
cembinatien e
is a veqiured elt
a maa
te get t e
inseted i u t e
is = uwstien mank
\ a Audibl bell
a
\b = Backspace
eus ün
\ =
Horizortal tab
t =
SingaSingla quste
= = Deube uete
6
Elemeucts
he C Laguage
o to 9
Digits
White shase Blauk sace
Hoizonal tab ( t )
Nee line (\n)
d)Special Chanactey- slam
back las
Tld
&Anmauuaud
A CJot
*Asteisk
C)Panenthoir
3Boace
CBrackes
hat »ebarate
text ingr
Delimiteu-
) (Ham)>Preproce Ssor divective
/vaniahla epanator
chage
C C e m m a ) » addhem
statemets
3CEacen)> Scope o
dleclanatien
(Backetr)> Avmay
C
(aneut hein)-> For expremen k suctiom
) tatemetts
(semicelen) > Tenminates
Ccelen) Unelul fer label
There ane nertnved coNd b Compil
Keycconda -
aud cou!t be ned a au identifen (vaniable/fuuction
abhay namen ).
e
duwung
is a vaue hat deea nst chauga
CCwtauts-TH
-S Tis is à stin
Shing Ceta
valua h a t may
clauge Ttmut be
Vaiable is
a
6)Vanables- aud namt
declared by its datatyhe
Daayhe-- to 124]
(7%c) Signad -128
chan (1Byte)
Chanacle Uhwiged lo to 25s]
|-17E-306 toI7E+3o6]
te i.lE14332]
ongdeuble(toByte) (L4)- [-3.4 E-4937
Cenweuien Chanateys
Roy
Sne (Fomat sbirg )
fermat opLhen
dataiyh eyeero
O m a k i n A s i t u a t i o w
, C
pato
if..ele
) erecute
a
a)f -uned
to
S t a d e n m a u d a
(Ttecuhive)
de-colil Lco
Loop
©
lils
Jeop,
loop, ) sletemats
C) Jor
pato
u u c e n d i i a - a l j i
an stha
Stateneutk-Tek Je te
en at
Conthel rom
Juw
trane tA
Uned to baeak.
HCortinu
,C)
a)gto,