0% found this document useful (0 votes)
2K views130 pages

C Programming Notes

Complete C Programming Notes Looking to deepen your understanding of C programming? I've compiled a set of detailed handwritten notes that cover key concepts, syntax, and best practices Perfect for beginners and anyone looking to level up their DBMS skills

Uploaded by

Rodhiya Shashank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
2K views130 pages

C Programming Notes

Complete C Programming Notes Looking to deepen your understanding of C programming? I've compiled a set of detailed handwritten notes that cover key concepts, syntax, and best practices Perfect for beginners and anyone looking to level up their DBMS skills

Uploaded by

Rodhiya Shashank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
____Bundamentats af “c’ language ___ yi nat 13 c Language ? | ange C is. Q computes bx ogxamming Language -C langu- “|-age steplaced tuaditionat byogyamming Languages 04 ‘HRat_dfme Like FORTRAN, PLT and Algor - “1S uog developed uf 194 ab AT and q's bell _Jlaboratonltes. USS,“ Denn Ritchie” vfs Rnown L | wile af Clanguage -C Success. = dull combihes _dfie_gthiuchue oj HlL ana tRe paws and efeiency of assemoly language cx jeg gegen @ |) tow fovel _#1.C_ has _a_uelatiiely easien_syntax -tRan_ FORTRAN, [— Cogol and PASCAL- - 1 _ aC ds on ed{feionl_ond Jost pwc ming longu 9+ fs_mone HERS ion teh 22S Ae wage contains vast set of data _iypes as ' | Compoxed te languages._o} _1t¢_ times. - 44_C language hag 38 most commonly used Key wd3- Qn addHon, @ Keywords axe used _ ut {Cm puagsamming — _ Bil c loge e a highly, bartabls longuag __—_. Shia means, you have ¢xeake cla ¢ -guam On one Combulen- OF with sry oy MS ater Computers witfiouk Any yrodéivations ~ ony excephon may be a very er rent ty be 64 openating Sysiem jfar us ol edie -Rble ui “otdgy Qs. vn whieh buee been cueated: —64C Ps Query ‘well suited language fon ——Struchined prog samming Ihe phog tammey ——ton_eanily dite on dhts @ number = eS ay d! acting. = 5 4 ; —SiC_has_got_a_o ch_se of — l Oty Un Chore, ek gested get bindle Steady Ege ae cul don_gaaphfin bag a arnt. —extendible language - Yhfe meant echons uo de, - __ Alphabets = Words = Senten ces- =) Poniag Habhs - — Leaning. Cc paogaa ming:clot. Symiat ised ie ebwes- = ~bet df git on Sheci Lenk “9 piece_o}, QnJon mation Ailphabets= 8 (Leer ve Ye Digits +a 42,3 «8,9 Ps [Spectae == Oh 48, 7 lta dL Syjenbals iis, | _ Here, Commas oe “used. ka “sehanale dwa ‘and 3b _fs also @x+ tweated as a_ Obed shed _— - 44 Silpha bejs = C_Ch ~Chanaciey_S “Set Subboss s alphabets om, Ato Zand @-z~Nate Rot 7 CdS case aus doe Lage WuRith mmean) a than (0-7) capital (A - 1) us didtexen ts oom - ' ee abi ‘sh hs ay) Digits = -C. chonacter Sel suppootl al “6 de 4- _combtnali on ef valtol _c-- —— ana. e duom dats ‘i Mahanerk Ons = C Tokens: 4n ¢ language Re smallest Gnd =Viduab Units ane called ag tokep { [ “iybes of Cc Slokeng_] - “eC keuade Gey Wad eo pagina _ aoe ee i ae pe et jieae kyFloal__Fay Fon goto id Gnt — , Jon example C&S asays . 2° OnO. 0-I__Hexadecimal Gn; —by Combsthalitsng FI Condon, aye. [Link]——— f digits. dom. 9 bog genie ARA okaQm 20 _ |-mactex.a_gsimn A ts_F on alone - oO ho. Is Siok from lo to 18 aoe..wepr @ented by chaaacken Abt sieabectivel,. . _ [Rules Fon. Con Stiuatihg. Integer Canstants = . An Qntegen Constant musi-have atleast one obigiy — aa t_must._pat havea decfinal bofht= — ae Se_elfier positive_o4 negative. _ — us Qt is_assumed_to 6° _hositive, 94 Rene [& na sign —|Sbecijieds - ae —_84Shacss ond Commas_ane_pot_allaned 1th ih. $f can have valueg Jyvom -83,469+2a700 _€xambie > 5 Gn, 605 ~ ——29/Real Constants = Real eamatants_an © used te wep. x yanedane Sent Re —quantities_daob vos Hapidly. he ©xampbica of- Such Quantities ate ———_clBtances, wei bts,—hefg bts _and_prii®eo. Real conat- oe hats called ag. gloating. parot_Constants —Real _eonstants_one qunitRen_of twa typegs 45, Rea Constont uhh... quactimal foum - - ——~84, Real _Cnstant fp exponential. dorm. ~~ jpRules Jon _Conoiuelfan ol. Real _Constanis fh :fuachiinal —---peorury _ ° ti ay St must have atleast one digit : must have a_deciinal bontst Qt could de ether positive on negative -_ - AHll Positive JB considened an Jfte_dayaulk sign -__ ox Ben Ie 125-9605 joce ;, i8_man bank . ano “aera _ oe _ "24 yhe ‘mantt } be hasiifie on neoaina : 34h. Mhe exbonent. must Cmlath an Tad ____us!_b@_an Gnteger of any sign _ “4 Yhe —deoultsfgn. Jor both tankasaanc ie exponent. is _posilive __ : “21 St -con—hare— valus deem wange 3 BU! a8 Ip aveSame valid seal Constants _© at -xpsensed fin _|_exbonentfal_jowm ane +a. 8e=4,8-3e68, -[Link] ~ —_aa|Chauqeten Constante = dn _adleli Hon _tn mumenie_ fe eanstants,_ 48 __@ @.—_pr10.grarn, afs0_ need to deal _with characters and ain? ——|-nttties_like_mame, plece_oxn_gend Character Constants ae used_ qfpSxpuess gen lon. Whey can _ be_a_sfngle_chanactex a cal of slctastens On bac! Ralach—chanacten_Canatants aigit uoitAfh angle Gplates ote be tnealed ag single Chasractey Comgtank - Some valid chanactex Cmstants ane: fq’ ter ty) ear eye 3 — Tai ciasalvatimal ao: op @ Chas. = ae ens Con = rtaths a sing e chanaol:) a felled. as_ainteg. “these _camstants ane e@nelacod mA double ® axe! ‘Hemant! “shia ” tyag|)") 54 iM Monks- same. valtcl_atrutng Comstants ag glad Usife be tuealed ag. —led—chortactexs clexs_om AGI unt cleutis quotes - Wain ceaciosandaos aaa he abou. —desestibed chasactey r=. ge. 9 SUbboute some Sbeciak (Chasacten _congtanks_ Ral axe called ''€scabe_ / ayences"= Backslash chanacter_constants or é[int eng] Gmina [Beane | — i eet alext| ‘N\y! vYextfoal tab : & NE ye \o—lchgpacs| —-\"—__} flo ae I \E Foumjeed t ; ie ble g ae | “An f Uestien maz! t—\n ee \2 ; 4d — Sample Butoy =a J C he ane a] Bale ca ie te, i a mle i Scone nee sues may drag” unfe come= Date ~\ | : Page ———_ combbens oe -Toust Star usifR a chanaclen - pas cus nek cullowme d uniAin_a@ ee sit yt Symabel, exceht tae underscore (a) 7 ds_aWowed __BS[ he Voutable name canal be Some as_any key Word + oe 6:| Some examples qj. valfd _vaxfable namen ose Ht # hem, Sanyo bn loy| |Variiable Declanatiey fi th Perens fot coma Pas hte ae a a bea iat URE 9nital | value _ af _uonfoble- jon Example fellourh hg statement — _ dleclanen a Siete ol at: shtege lype Ond Sptabeen ln BYay Qnt_bosie gal = Bui om + Nt Datatype Datatype nebuesenks typeof Sop _—_ to _be “coated uh ie Vania te | “dna hiflig ave atin’ cupped dats _ is tye age ———— : L Pyfray data many dat _tybes = Bi f ndoamental date- . 4 Te —— peo nts Suppoted— ; — by ‘all_C_Combiboxia hese ome a1 Qnlegea -—-S_Chasactex 2% Float UY Double paecuion Haul 22 Untege~ dain tupel dntegen data t PES ARE L —— fo Slowe Numenie data The mnt fan Stow what numbers O35... well as eS unt donc tone he data types q iis hout Wlhegen, long Anke ve Qn addthen | 22 typ © unstated Ont, Unsisne Shout nt ard Uns yned dong ant data ty : { under Ghty cal Gry -fellowing kei re 2 ‘Numd Colegeny axe ' rat tall Qf deocribes all Int cata TYybes tir— _fStoes Inbegen(n } Deseritption —_ > dtacti mal} val ues unaired | Stores Integen( Qnt | Bates | . }4o+38 468 {bet tve andve | = Nengractfonat) | 595 _ values Range _ 0 toe, Showt fiat Stories Qnbegen |-\e9 to. py = - i eee ~~ beng que oot Juactions- es alll soa powhtolata pi 0: Floating. Path olaia types useal_is Store ‘num fabler doncaib- { hype :___ data Fee - he - Gane oo - oe enclosed fh single gpotatirn ma kg (8 Chon Aand_tinsigned chan ane Kno cha a tela ~ yes — Stones Chasacter Values “unsigned Stones Charsachery chaxyt Values(—) bare 7 ef. QO ‘ ened data types > doited dato tupes ane j{- — alsa called aa” shiuclunee dato tybes- he math difference between Jundo- -mentat_and dexnved data types Ja bat a _[vantable of denfuedl cata type can handle mone tan one yalues at a me - Whereas a vasiake fe data types Can hance only — ae_value at tine. Yhe data types wh SATS axe annoys, Bhtih9 3, Structuse and unions - 9 [ses defiod dala pes = Sihoos ane sto. dala | fypeg tat axe delinad hy [ceux - ey -Contafn_usex Geyt Sheciied values. Siu, Ikeut i y| Patter data types P- Pethien wa a data Nhe uftat_ handles de olala a, fet Lis memory aclarena faferample an gnke ges Variak Sole ges Value hes holda addeem 4} Saleger Vax: 1 Vaid data -ype + Voicl_clab_tybe we py esenis! ___ On Mull Whis datorpe (us uged ween a pankoulay sunchin does - oe wetuin doy value —Shin tice ute cher Prens. ALL £5. ftom Keybia, Afnawa ¢ Language l- Gonor’s oo Me ct tof tat occ —Sh_afie_prioguom, Share aie mainly dite dul “0 : 24 Rn tine @HnNOY qs M wd agtoaP Cynon e1Semanie_eunan - a -te se swues_ot usiting é aysie ane z He detect tod by Compifen and hug ae Beenas _Combite tine enews Mag Frequent £ Suntax e: += OHS_ane 1Mtsstng Peponifte sis {F) - a 1 Pus sfaFing Jee value ol variable witfout declosting tt if 4 Mts sing. Serileston “Like bia - _ The brgaram to ivainalea: Ae fn faclude Void math (4 - a lint _n=q, div =o = umm fui oo div = nfoz | | Baby ("aseubt tc, div); ee Linke Friniong = Yhese@ exsion occung UBen ater Com= ——— -bfalim ine [ink thie difjevent object ditea wif. —molalg. object Using_cht. ¥e N (Riv) Sihese ase esos gqenekated wien: spot nes peg ig po ti E a en - ——-Exanpte_o} Linker exsen 18 = - hte mogudm to iPustiake _ ts aa yt fobs — a MRSC Miata ema | - {nf _o_s ~ — 2a Exon = ___* Gext 40 X86) wundejihed seJerence ty'matn’ — i legial exsanig? Oa tambien cad execuliong bxoguam_ destined. Gubut 19 ean __labtatied —woRen_ -C-eytain abut values ane give —.Uhese_tybes_ Owione WAR brake gee _ —=ct_outbul_bul *HOH fue aye Called logica® Cnnang ~ Y hese ane ome ot tRe — a most — Coen roc ensia e — Bese ee 1 — he (ag Me Tet — . ee int =e; - / . i] logical “eriax. =a ‘emfecon aes asp 7—— pollen tesytteg, a | nC Oo putty t "lea Di ns __ Contihue > a — iy oo _ getchan(), ———e ——sebunt gp 4 Gee a 59 Semanti pg = Ube oecwis Lofen th statements Statements tnsiitien fn Ro —____fxamble_of Semantic Cynon ig —__—Il¢ progam ts ifPustwate Sem ante exsion_ _ —— Vaid gf - fit ober; 2 -——- : a otb=cr [lgemantic ey sey _ i - -—.§unoy= “Cxtion : ren ue Hequised xd_ag_le}t corond af asa pan: — ent ath=c¢; Il Semantic Guroy How does _o buagtam Executed: mhenever to . _ - eter git S a “Comp ied ard execuled, “ie Combiter generale Some fife UIR Same mame as dat ol ‘ Progcrm ite but wit dig ferent extep ston Pf -Below ef 0e 4 “Sg Wf IB RE qifes_created_at each st “t = de ee eapiraty naan aoa —Yhe mah _ Key deatune tS ae ay ©m_ bio - — ni Salem po ST ay HUL_lan guages Hate “he Second Aealune gf ¢ a ._fragaammtag . Yo eatbiti ry: Flexi bith MEARS haseibitif,— +04 pregoamrns bo CGmbrol Nae ronguage | - wn larg e -proganis! 9 Sub- Soaee a, odutonyk- Posabitry be. bteak do oa —'ls Staal roduPes Usity uy) fovlabitiy fa nga Incleben den progaoim Si fetenstbtyt- f ost Ui ly to add new) 2focet (Loc. by preqrammer. gge at oberainys i : ‘Ond variakles- “ ° oo > 24 7 ‘oped south =to add no on mose Gnkegens | ant floats. _ Subbiochim cbemnton" —" ofS used to _caleuPate te cliffenenas of tue aan HS on floots- «hy, — cof tuulifplieesien obenalan = Muttiplication _apeaaion —_t used lo calcuPate Re bsroduet at tuo on mone GnlegenS_on floats. : — i _dS_diviston. inn P= Dvision aberaimy /" fe used —- _ fo Se wane 4 LAK emainderx, ig ae ee —— = - I naam, oranlealigge Soe a es ste cag - Con=— - Conn ust 2—quoltink tat Papin —:eny Qmboutant ft ot ad _ cacls_aa fh_puograre fin expe skalement_ sion _containing one on intial apenas ecat id peauial to ohennton (=) + fa used fr Combore hog 9 anti tte, font thy .Y ho hse- F Ssjem usP ywoluun Suue 94 cam pose: Warmgbler can tagn © 24 less tfan_oberalm( A at 7 7 : : “ - ay —cuxnent fg k writPP become — 4 Uhe equivalent fable ctotement is f=) -4 — iEby Gm 04 _ tre Vanable f3_ “led teed fh om and fen —Snotemented oy deoremented- _ othe. Beatger—fuose ment to decsenent fens ——s_gett Pos }ik Qnorement ie Value o. oa} “fA: “Ghat __ “—~_means, 94 ¢warent Value o: fo F Ot coriPP becane i Met Senile hee StaJersen! is_ Ase Ads: ee 22 Poabai eement ifs. value a se deka koma at Pit A ail. Maal - - lised fh advanced Syé! em ge dromihg ot Some SpeciaP fasks like ens ra data Combycesaim C Suppor! _6 bsf swiss “glen fat change Re bits. dala items fi va bho {fat Bit wige se a ana miipulies dhe. bite. Athi ob ian. Biarstess Deaeniption pty | ___ Rg ht shige 4 ta 8Fc tse nD Ts iy eines yh ae eee [abe esata frmespim dihg_bit f euduale 2 HE Qnclude Naicl main} i = Qnt_O = labs aS - —— Peal, Cantal Gea G8); ie ee —— TP Oltbit= 3 —= — Qa=0 —= Sc 23 Bituise OR aton E-P | J “the Cubul e] fiat of fe 4 oF lea ane Comsaghon alt bit a} two operands th 4-4n_¢ pragcamming bitwise OR openatoy, Us denoted by fe a ket us suppose tRat bitwise OR —openatert, ~~ 9 ~fwa Qntegens ane 18,85 _ 85-=ottoad To iho ne ° = — _Snchuide _ : —— fed train) - - oo ___9nt a =la- ———hetol__ math) —— | f a — — Fe “ Qutbut = "ed" a! rho ee — ~ Ouibul_uate a&Spla yan — ——-_Ontpuk =a oe Complement “ober on only oe. _epexand) exatot fs an unary —apenato ( soMRS Ine ~ 9t Changes dt- Ietus_ suppose iat Bihuise Complement H “cheno Baca e Component sg lager se TP —- —1t0d4toa_= > Bel deca . —l9 a Complement _ opexator th | re SRS on piegaene ; | void math C) / —— _i__ "| Pafhy (eau puke Jacl”, ~ 98) pasa [Output Jad" ~~ 1a) _ | Bias = ge ttodatle Bin phony yhoo 8 sia —__dasr4 = coaooont_[ an Bhonys— — — Bla 27 8 = Qonoocat ens -ale%0 = Hololos [Na shifi oS “HL dett Ship opera Bhi Speyis_all_bile lowasce Leg - pam bo nC bye a Gerla ~Sbecitied bits -Yhe 4 bY postions | inal ee * eee by Le} Shifk- ie Que if me ili Spent lel aie -opexcion ~Jy | dias t4aJolon £40. [-4n_binaay 7 — : [apes & «Hae Joop ind eft Shy by or r ala Vor main () : oe if aye = 33920 de, | L Ink num = ale ig : : ~ tow liso; le2a;#4) ay Wa cage by Jod Hen Ipnumoers) — Fev ted Nel » a Sy toctadln’ 1, mumect), a _ Shecia® openaings / 1p Gamma Operate med ee apa Can whe Used 1 _jink ipo nel ated __Exbxemmns. ageliey ONC xelaies _-i €xam ee — Comma. na_operotax tas ie a 4 ubla=2, 6-2, ¢23. 4= i yea fy é ype qaceae ae ‘ £. — type. © Gxampie? dye. $$ “= ~ | Hoa 1a-S> int Gs —— — ’ = (Qni} ¢;— —— toe q—Vvolue ig 18 Sagres / oxoton the Hat uses pal ite fetes adi neu) = Tou ig nelecl Hak yas ges._hathion uaa ~Mhig Rolled _ Perper Qt ceca teaa —0n_pottien vanioble and stekara | value eeu. _ —shalent -to—_valuc_ot_portnten oldacy, ——____— ———-oyninsPe ~ oul ofeler cbexainté- Oo ov bio. ‘eres » a : double ponte point fe _— dnctRery_ hovhhont Varia ble_acl abieas » - Sy ntaag- - datatype “hee1 oe Ce fof Hebtuends thy 2 aor of apexaton £- Size rr - arze of van fab Les tay __{s, ntax b- ee es - hdl " Size_of (data... type) eee — __ $4 Inelude =Sldi-h> . See SS Gahe 28a cha b= "Bi; _—_— a : Pay c S I7guquq4euggau: | Patt mem. ou /o _ ry + Output --- oo She of a ies _ ($e. of 6 124 Size of C182 g. - Memory ah = Ieeuerean -““Shwctune a) CEC has diferent Sectfa, - oe aS “he Sections of —¢ brag, — ane listed below eo ee a dncludes jae slat oe “Ment Sheclyf - bea Punnt \ 1 sbecitted at _\ke Seginning Se 9 piagvarn ‘se As _bieg:[matde With be Consfeleney Sas {pe dacumentatian_. { v _ Qrien Jone WF IR Sheoitied Cade r - ation Canta fn all JjRe ~ a = fonmMs - itt Sy to_Jink Re headew ea He - Sy ae 2 2B 2° o SN it i — ———— —___3# lnelude - he # Gnclude Statement fheludes te 3 feos _o bam of a dJunelfon at He time tte ComabiPa tian thug whe camtents —_o4 — Be Sincluded JiPe ane Cambifed alg uk He —dunetion befng Cmobited= Une Include ———,- 9) .= od da ee sees ina pie — —=am- a .. ail _Sectim: Qhe dejfhe Sectim Comby i, — pattie Sect ol alt a Cans tants_ deel, ~ se Usk the, des De es Ot Fagin G = a“ 4+ desing O28 is decloratin on & ho globae Section Comprise all uAe qLobat dleclang. Ty. | - lions Jo “dae bean Sts given by | Floah num = 2-8 jan eG; a a . _ Chan ch ='7', _ _ a She “Ste abe i _ se en as vanfabis a3, . tt oa s — —) Qnty —l we ps Ge abo iene Tags ages —fr_globat vantat kins — — ction: maine 1 Mafa_unction: a Lae “Tk hewn eee iy gate pul ~ afin) 8tta nat $a eae Ei Ge _=hle_ ibang. tear b S{) et : ae ee oeWhe matin quvetion fg declaned as, br | : ; MalhQ) a | wwe can alga Use nt anh oa, wit Reo | maton (|. She Votd main Q Shecities Rah _ | Be -buagttam WIPE not Hetusn : q AY valuehe | Sot main) Shecifica Bat He hxc -g tm can ye toin dategen type datas a - Qnt matic J ne ; _ a. - -.___Naid_math(} —_| Math Junction fs fuiiies colegouts edi fay lecal, locqe_declawatiimg "he Vowidbie gaat fa deci. = aied_fnside_a_gfuen gunction on hlack uetexs fs as Jncal declatationg?-_ | maf} If 1 int is O35 itt - : : x - il Statom enig> rer the use Of chexotons. 9 glory + = be — —Loshy —pe eae—_ tequizement xm ~ - Coloul ) a ee te Pog ay” fsted above | ellos “tae Same gection_as_t a a —|_urficn we be ctfies Man Be Vaid ~% _ - Speci ied uri Hie qunciion: Return “tee _ ae) Fuze Conk wert fo Shecitica ag dea 19 f given bay ——+ - I Wehuin > - - Fou € ambie = 4. pee tl — as i _—— —_—— _ Sample faegian Cu Baap Co —— py eA8y aia aise — namming. th Cty __ bso >a Opexatant Precedence f- - - Obenaton buecedenco _ detest mihes Wwhfoh operaton f perxtJdoumedl | gins Ph_an__€xbue@asion wits mone Ran One operators ugh _olienen + —_preccolence Centafn operates have higher hue co dence Ran | athex9-_qdou -€xam ple He mulifpliag tion opesaloy _ haa highest psecedence_tan_addilion oposatnus | — - Jou examp le Xefae 2 qe X13 _aniened ca __| met 0 becaue r-obe rato hon highen pxec~ ‘-endence fan + : youlh~_ iz THR 3% n_ddoa fiyy. | Posts Ot 2 Lelie fn ig hp — Unarny rhe [oer -{ty} HSI: = i H Multiplicative, 7K] Of, —_ | hej ro ug ny _ ihe - ork - at to Hugb4 —_| Shit et fo_ ight _ col - >> | St im nigh? F Cayuaty | = = 1 Yigje te mcgne |Rituisc anol Bt fo elt —{BikwisexoR | fej} bo ght pa op oS Leg ta vig — rool A _ th ugh Pcie OR aA nt fo vght Conch benaf _& 7 Right Les As uanment |= t= -="=/2%=>y= Vafie) main (.) — _ a - | Qnt a = lon b=2ene ln ds8e=les I Heth > I Yem=atb/e- de = ey a fas od", Hei);

You might also like