C-Programming ShortNotes
C-Programming ShortNotes
3)3n signd Hepresen. HLMove cxta Casee Adu autr stmt cOn bt in ang
O's and i's Oder Ond brcak & SPinal.
4)Stmt OUtstclu (ngt inany cau) u
l9) pring docs not car data tHP, ignGrea.
spraficT marchcd.
crro
NOTE: printj("Hy")NOt on
) EtcNAiOn only tooK RHS, Wbyeak takcs cet Jesp /8witca.
signed ’ gn CxeiOn 2)COnine takes to nCXt terahon
Unsi_nd (Condiin Chccking) OP.
2)TTun cahon TÜKe YCirC no l ShOrthand NOtahOn:
VopCxp)
Vop= exp = V=
13) Char i a mCUl in bitr4 tt (constanl/expr) gives ciTOT
Chor C: 9 ttLatb-2)
3)3ncrement ,decremCnt speat
wt gNe ChOacrer then itt uscol with variabu.
is 9niy
) nteaes PrOMOtiOn: WhenevY Smal
RigAt ahit > L+ by 2)
CxPrCsOn , itt Cmplidty Convot ed NOTE: 23 , (2)* - 26
t9 int(32bit3)
2's cOn (-x) -|
Always cvaluatt cxpi sirSt (SCApcive
9) p= ) -p:( becor =has hiGhC short dYuiting
I0) !0 = |
9ct pastix operCuos COmcs intG
4sect o4tr scquNu point (; 2 I1)
expi? exp2: p3, y cxpl
Cxp2 t9 prcUdence then Sve Jrom
elsee exp3
Convest nutd ttr noTy OPeraror Cnto leyt to ight.
i4elac then slve.
" a?b:cld:c abCidic
4a ) DCciasatíOn; int b);
int mul Cinta,int
oY Únt mullint, );
G m l lint, int):
By dyatupc omul
is int
Use e 2) main) Fun is net decloncd
coma Gpra t : CVouatcd 7om (e
Compiles CUssMA that fun() ç
is Valuu a cSmbintd Cxp.UsIe fu int HetUYn type. Katcr
(2=10, y-s, nty) i<=s, Í>=) n definahOnj 0ssum pion ii Cht
cuiv. t9 1s Cuiv to j2O thnng c O GthcTwse Comp'
# Prece denc Table time ersOs
OPeratOTA |ASOIa Comptlahion SyStcm :
ivity hello
0,CJ,’," ,+t, -- (PONix)L’R Aeil pre +withCocle Comale}Aems
unory ! , ,t, *,2,sige ASsemser
Avithmei
|typccast , +t - - (Pyix) R2
diu in memoy
Alinktrt Rusca Qbu Gajec
CScu Cbinoy co)
"Linkes is a manual task. Jt by
dyault tinks JIqUiYe fres tiia
Relahoncl Printg'.
<,<=, >, 7= LR |oHtadcr iu stcioh Ony Contains
LR dce oraion buidin funhSrl.
Bitwije "0 Jilu contains dyinihon.
Jt wll Complu beco
PnngL); Comoiler wtl CsUmL
type uwich cYt.
Legical
| LRNOTE: filel Thee a diles cont
Tenory 2: |R’2 moinc) moint) be mersea as a
ASAi^Amert t*,-=)*, ,=) Prg Yam cant
hCN 2 mmain (uncin.
RL NOTE main ( )
int a; NO CSY Y
Coma
intbi7
ombiguous f) * DcAaIation: nceded bs Comotlec
NOTE: &: f)t ál) u
in ang
! AO Con be e val uatcd fined. int tun) cHern int fun);
sequenca, rder A ngt
ínt
int dun cÁpriNt l"Hy");4
lO(aL as extern lways point
Stodk to s0baL vaiablu.
) Stahc : Compiu tim alOCChOn Heop Storae 8tahc dnitiCize:0
2)siaK: Runtimu alOcahôn (AchVaHoh | AV aulCbe t9 LinKer
YCOT)
DHOp&RUntimu alloc using mauc) Vor/fu is declorcd but nOt
deyineal , t will hOVe tinKer (YYGr Cnty
"ut
* FUncion paramtr Cant be static
: CCn &e Voriablu (Compi time
oAJehime : is voriabu in måmoy NOTE: Cxtern int a, 2 nG error
)Auts 8torage Clas: extern int a,
" Storoe: Stac "SCOpe i:within bO Cl0bly we Cant have any s t t
*
"kifehim : cnol blu 9the than oleuor ciên A
inta; inittau3ahon voi ades.
int i= I0;
" not ONoilablu t9 einkr. (-S: <- ompiu tinme c s s
NOTE Quto 4 HSisRr OÝ Clwys wseol ## Poirtes
with l9Cal van . J4 usec with Value
1) 3nitiaigd
global var then compilahn entr.|2)int* p =
withh gar bag
cnt *p
2) RC_istty sOTage lOs: 3) We cant kavc cdcTes & Consta,
" Wbing it we eCemmcnd compiler to
Keep it in HCHstcr Posible.
|) AlL petnter siz is 3amu lB
deyault B3).
3) Stah stos age clas:
" NOF ONail0blu’ Arayi
t9 tinker
" SusPe: within bl0cc accesea
;Aiqeimu : cnd pram ouKicu fu hor arY ES)*'a,'byl a, b, \e, lo,)o
btahc int a; CAccutca nly Onc.
NOTE: GbuCanvatt d ason intialiged to a Wa,bd,lo
be usCd 9ther ftes 3) Chay axr C5]z àbcd; lab.C.a
Chor cNY(47"abc d"
) ExteTn torOSL Lass
oUsea to ees gl0baL voT Yfunchons 4) Chor asray ending with N l 1o
in sam aile oß othes. is treat cd Cis stng
5)int aYt]-a','5,'y: Il aYl3J
Jt tews Compiles "Dont wos, VÛriabe (nt ay[3-"abl", /aY[4]
"Functions cu by cleault exttyn.
NOTE: Fu ancant be dej'ncd insid bl0CK"
b dedared
6) cnt arCJ; 12) PUSSinS Cosay as paranmurt
Eithtr Provicu dimeniOn G7 dedorooh mainl)
Rtrt L(S): fun Lint t a) Senitrray
) Aray namu Cant bt USed n LHS funlint al])one
= fun(a);} funlint alis]) on
8) 813co() cocs nôt cradUase exprOSiOn onty base acdsess u pscd. isrord
siALeLitt) +iwill not incrncrt. 3) Chor ay[5], scanl",Ürs1);
Jt tçu sie in Bytcs. Enter 4 hos Cus o wil put 'l0'UoS
9) POintcYA 0u incrcment¡ by thu si3 at end. st wL entr s choT ,it moy
(Cad tG
strltn): COunt ng. CAos Cxupt lo
cturns
Jt AetuYns unigned int.
J) int a Cio a point to iYSH strlenl"Hlo)
ele at01.
2)a dOeA ng have box se it (0nt9tmp) Cômpes CAo by ChOs
lbc LHS
n LHS CUsi §nmet. Stronp K1, 62) I 941>62 ad>abc
3) x= B1 B2 B By
’ I6B
cast.
(slz Pointes Naki suT ts test thi
SiCA (ONtO) ’8B mmall9c makes a ysttm Cl
’Dia<LNCL bectwcen tws pointcIs frCel Ch) ’ ts ree Cllscatcl memog
allocattd
Pr 4 P2 mUst pi nt to emnts ch is stay h'ny Calor
will geve erroY.
Pa- P = free (ch) ’EnUr CA Heap
ndt sl3-0)
8) Dangng Pointe Y psintt frced.
te memoY6) stUG std (3)3
tha hs al Ode beCn
3 a ptbim tt deeercol (*P)
CRUntinme este)
9) Menoy lok is memy wich hasnt |mainc JuntstiucF stuod t)
bcen trced a theu s no way t
HeTe t is a (oCol
lo) Char C: sCon(" As", c); CYor
Cs memoy is not rCServed fos Jun s); au copied to t.
8stng" 3) Pinter t9 strUctUnei
NOTE: EOF End jeu (spci al sHmbl u std * pty =
dyind ên atd)
) acTo3: #din pluus
ne semices o) *pts)r =5 S
Evtrywhere replaca pluslx)
plus by tan
| has fhigher prtacna.
Cômputai on, simpy replaCL
1)C porammin8 uses Gmly cal by valuNOTE: Btoten (" HeeCs") s
(never cal bg ycrtna). MHeLO" ClGCaecl in 3taie a a
) Stotíc SAPing C uscs u CBydeoul then basi addr & given to sun
se GLObae vnsi able |2) COPying One strut to anathes
done Cat cOmpile time.
-3 DyNamic scoeng
use PreviOUs. dun ariabu
don at unhme
#Strutuse elmernt b lunt.
) dtruCt Xy3 3()>niceon Cant dS (X=-) ’ERROR
is mUst
2) typedey unsignd Chor XH•; 4) Stoan8stsuct Gn memy alignment
Avanabl is stUrecl ony at places
typtdey is usco ts givL nomu tS Custom whe starin Cdor is b size
tyPCs.
Statt with si3e e i98Cat voTiQEu.
) typccdy stu (stuc)
Sname a opti8na4 4shost tnt a[S];
tong b;
F4)strut
daia type <
stdB int ;
stsuct std (6)= I0, S04 eHemy dara yp
1 Rsunt o pointer alscad 16) 8ts uct s n agned
S) Array suetuses:
8truct Std sLI0T; |I) B dyaur struer aindl
dOr optim(3aton.
V DyOamic nemorY CeloCarian:
J) C d not sUppUTt Chaïning auocaior Cut Untime.
per atso.
|3) Alicsing: ituaHon whve samu
memoy LOCCron Can bC accescd
> (l0<-)<-| Using did&ercnt names.
to ntgh main) lint *a int*b)
2) ngintk recursicn t Kecp calling d int c:S,
>Unin: |)Aembler uscs L9Cahn count r to
HenorH is shasCd bluw Vaxiabl s.
RejcTen count is Usea by garbage
Variable Coucctor t clcos memosy whOsL
COce.
S) Dynamc data struchure that chonsu
Memory U allOCatd at unHme.
6) [n taic data srUct, sie is tixcd