KLiC C Programming
KLiC C Programming
CCPr
ogr
ammi
ng
Det
ail
edSy
ll
abus:
KLi
CCPr
ogr
ammi
ng
1)Get
ti
ngSt
art
ed
Br
iefI
ntr
oduct
ion
Pr
ogr
ammi
ngLanguage
AboutCPr
ogr
ammi
ng
CChar
act
erSet
Const
ant
s,Var
iabl
es&Key
wor
ds
Const
ant
sinC
Var
iabl
esi
nC
Wr
it
ingaCPr
ogr
am
I
nst
ruct
ionsandAssi
gnment
s
Basi
cOper
ator
sinCPr
ogr
ammi
ng
2)TheDeci
sionCont
rol
Str
uct
ure
Deci
sionsCont
rol
Str
uct
ure&t
heI
fSt
atement
Thei
f-
elseSt
atement
UseofLogi
cal
Oper
ator
s
Di
ff
erentt
ypesofOper
ator
s
Poi
ntst
oremember
3)LoopCont
rolSt
ruct
ure
Loopsandt
heWhi
l
eloop
Whi
l
eLoop
ForLoop
Oper
ator
sinLoop
TheOddLoop
Br
eakSt
atement
Cont
inueSt
atement
do-
whi
l
eloop
Ti
pst
oremember
4)CaseCont
rolSt
ruct
ure
Deci
sionsusi
ngswi
tch
TheTi
psandTr
aps
Swi
tchv
ersusi
f-
elseLadder
Thegot
okey
wor
d
5)Funct
ionsandPoi
nter
s
AboutFunct
ions
Passi
ngVal
uesbet
weenFunct
ions
ScopeRul
eofFunct
ions
Cal
l
ingConv
ent
ion
OneDi
ceyI
ssue
Adv
ancedFeat
uresofFunct
ions
Funct
ionDecl
arat
ionandPr
otot
ypes
Cal
lbyVal
ueorCal
lbyRef
erence
AnI
ntr
oduct
iont
oPoi
nter
s
Poi
nterNot
ati
on
Funct
ionCal
l
s
Basi
csofCal
lbyv
alueandcal
lbyr
efer
ence
Concl
usi
ons
Recur
sion
Recur
sionandSt
ack
Addi
ngFunct
ionst
otheLi
brar
y
6)Dat
aTy
pesRev
isi
ted
Dat
aty
pe
I
ntegernumberv
ari
abl
es
I
nteger
s,si
gnedandunsi
gned
Char
s,si
gnedandunsi
gned
Fl
oat
sandDoubl
es
I
ssuesr
elat
edt
oDat
aty
pes
St
orageCl
assesi
nC
Aut
omat
icSt
orageCl
ass
Regi
sterSt
orageCl
ass
St
ati
cSt
orageCl
ass
Ext
ernal
Stor
ageCl
ass
Tost
udyt
heGr
oundr
ulesf
ort
heSt
orageCl
ass
7)TheCPr
epr
ocessor
Feat
uresofCPr
epr
ocessor
Pr
epr
ocessorandMacr
oDi
rect
ives
Macr
oswi
thAr
gument
sandMacr
osv
ersusFunct
ions
Var
iousDi
rect
ives
8)Ar
ray
s
AboutAr
ray
UsageofAr
ras
Poi
nter
sandAr
ray
s
Passi
nganEnt
ir
eAr
rayt
oaFunct
ion
TwoDi
mensi
onal
Arr
ays
I
nit
ial
i
zinga2-
Dimensi
onal
Arr
ay
Memor
yMapofa2-
Dimensi
onal
Arr
ay
Poi
nter
sand2-
Dimensi
onal
Arr
ays
Poi
ntert
oanAr
ray295
Passi
ng2-
Dar
rayt
oaFunct
ion
Ar
rayofPoi
nter
s
Thr
eeDi
mensi
onal
Arr
ay
9)Pupat
ingonSt
ri
ngs
Whatar
eSt
ri
ngs?
Poi
nter
sandSt
ri
ngs
St
andar
dLi
brar
ySt
ri
ngFunct
ions
Two-
Dimensi
onal
Arr
ayofChar
act
ers
Ar
rayofPoi
nter
stoSt
ri
ngs
Li
mit
ati
onsofAr
rayofPoi
nter
stoSt
ri
ngs
10) St
ruct
ures
WhyUseSt
ruct
ures?
Decl
ari
ngaSt
ruct
ure
Accessi
ngSt
ruct
ureEl
ement
s
Ar
rayofSt
ruct
ures
Addi
ti
onal
Feat
uresofSt
ruct
ures
UsesofSt
ruct
ures
11) Consol
eInput
/out
put
Ty
pesofI
/O
For
mat
tedConsol
eI/
OFunct
ions
spr
int
f()andsscanf
()Funct
ions
Unf
ormat
tedConsol
eI/
OFunct
ions
12) Fi
l
eInput
/Out
put
Dat
aOr
gani
zat
ion
Fi
l
eOper
ati
ons
Openi
ngaFi
l
e
Readi
ngf
rom aFi
l
e
Tr
oubl
einOpeni
ngaFi
l
e
Cl
osi
ngt
heFi
l
e
Count
ingChar
act
ers,
Tabs,
Spaces
AFi
l
e-copyPr
ogr
am
Wr
it
ingt
oaFi
l
e
Fi
l
eOpeni
ngModes
St
ri
ng(
li
ne)I
/Oi
nFi
l
es
TheAwkwar
dNewl
i
ne
Recor
dI/
OinFi
l
es
TextFi
l
esandBi
nar
yFi
l
es
Recor
dI/
ORev
isi
ted
Dat
abaseManagement
LowLev
elDi
skI
/O
ALowLev
elFi
l
e-copyPr
ogr
am
I
/OUnderWi
ndows
13) Mor
eIssuesi
nInput
/out
put
Usi
ngar
gcandar
gv
Det
ect
ingEr
ror
sinReadi
ng/
Wri
ti
ng
Expl
anat
ion
St
andar
dI/
ODev
ices
I
/ORedi
rect
ion
Redi
rect
ingt
heOut
put
Redi
rect
ingt
heI
nput&Bot
hWay
satOnce
14) Oper
ati
onsonBi
ts
Bi
naySy
stem &Bi
twi
seOper
ator
s
Bi
twi
seANDOper
ator
Bi
twi
seOROper
ator
Bi
twi
seXOROper
ator
One'
sCompl
ementOper
ator
Shi
ftOper
ator
Theshowbi
ts()Funct
ion
15) Mi
scel
laneousFeat
ures
Enumer
atedDat
aTy
peandi
tsuses
Under
standi
ngwi
thaPr
ogr
am
Renami
ngDat
aTy
peswi
tht
ypedef
Ty
pecast
ing
Bi
tFi
elds
Poi
nter
stoFunct
ions
Funct
ionsRet
urni
ngPoi
nter
s
Funct
ionswi
thVar
iabl
eNumberofAr
gument
s
Uni
ons&Uni
onofSt
ruct
ure
16) UnderWi
ndows535
UsesofWi
ndows
I
nteger
s
TheUseoft
ypedef
Poi
nter
sint
he32-
bitWor
ld
Memor
yManagement&Dev
iceAccess
DOSPr
ogr
ammi
ngModel
Wi
ndowsPr
ogr
ammi
ngModel
Ev
entDr
ivenModel
&Wi
ndowspr
ogr
ammi
ng
TheFi
rstWi
ndowsPr
ogr
am
Hungar
ianNot
ati
on
17) Wi
ndowsPr
ogr
ammi
ng
TheRol
eofaMessageBox
Her
eComest
hewi
ndows
Mor
eWi
ndows
AReal
-Wor
ldWi
ndow
Cr
eat
ionandDi
spl
ayi
ngofWi
ndow
I
nter
act
ionwi
thWi
ndow
React
ingt
oMessages
Pr
ogr
am I
nst
ances
18) Gr
aphi
csunderWi
ndows
Gr
aphi
csf
undament
als
Dev
iceI
ndependentDr
awi
ng
Hel
l
oWi
ndowspr
ogr
am
Dr
awi
ngShapes
Ty
pesofPens
Ty
pesofBr
ushes
CodeandResour
ces
Fr
eehandDr
awi
ng,
thePai
ntbr
ushSt
yle
Capt
uri
ngt
heMouse
Dev
iceCont
ext
,aCl
oserLook
Di
spl
ayi
ngaBi
tmap
Ani
mat
ionatWor
k
WM_
CREATEandOnCr
eat
e()
WM_
TIMERandOnTi
mer
()
Poi
ntst
oremember
19) i
nter
act
ionwi
thHar
dwar
e
Har
dwar
eInt
eract
ion
Har
dwar
eInt
eract
ion,
DOSPer
spect
ive
Har
dwar
eInt
eract
ion,
WindowsPer
spect
ive
Communi
cat
ionwi
thSt
orageDev
ices
TheReadSect
or()Funct
ion
Accessi
ngOt
herSt
orageDev
ices
Communi
cat
ionwi
thKey
boar
d
Dy
nami
cLi
nki
ng
Wi
ndowsHooks
CapsLocked,
Per
manent
ly
Mangl
i
ngKey
s
KeyLogger
20) UnderLi
nux
Whati
sLi
nux
CPr
ogr
ammi
ngUnderLi
nux
The‘
Hel
l
oLi
nux
’Pr
ogr
am
Pr
ocesses
Par
entandChi
l
dPr
ocesses
Mor
ePr
ocesses
Zombi
esandOr
phans
21) Mor
eLi
nuxPr
ogr
ammi
ng
Communi
cat
ionusi
ngSi
gnal
s
Handl
i
ngMul
ti
pleSi
gnal
s
Regi
ster
ingaCommonHandl
er
Bl
ocki
ngSi
gnal
s
Ev
entDr
ivenPr
ogr
ammi
ng
22) memor
yMappi
ng
I
ntr
oduct
iont
oMemor
yMap
Memor
yOr
gani
zat
ion
Segment
ati
on
Loadi
ngOS&Boot
ingPr
ocess
Ther
esi
dentandt
ransi
entmemor
yar
ea
Pr
ogr
am memor
yar
eaatr
unt
ime
Memor
yrepr
esent
ati
onofdat
a&f
unct
ionobj
ect
s
23) CTr
aps&Pi
tf
all
I
ntr
oduct
ion
Lexi
cal
pit
fal
l
s
Except
ions,
Str
ing&char
act
ers
Under
standi
ngDecl
arat
ion
Except
ionsi
nOper
ator
s'pr
ecedence
UseofSemi
col
ons
TheSwi
tchst
atement
Cal
l
ingf
unct
ions
TheDangl
i
ngel
sepr
obl
em
Li
nkages
Ext
ernal
Types
Expr
essi
onev
aluat
ionsequence
I
ssuesr
elat
edt
oact
ual
par
amet
ers
EshewSy
necdoche
Li
brar
yFunct
ion
Pr
epr
ocessor
Por
tabi
l
itypi
tf
all
s
Si
gned&Unsi
gnedchar
act
ers
Random number
s
Por
tabi
l
itypr
obl
ems
Pr
imeNumber
s
Rev
ersi
ngani
nteger