midterm review
play

Midterm Review CS304 Introduc1on to C Why C? - PowerPoint PPT Presentation

Midterm Review CS304 Introduc1on to C Why C? Difference between Python and C C compiler stages Basic syntax in C Pointers What is


  1. Midterm ¡Review ¡ CS304 ¡

  2. Introduc1on ¡to ¡C ¡ • Why ¡C? ¡ • Difference ¡between ¡Python ¡and ¡C ¡ • C ¡compiler ¡stages ¡ • Basic ¡syntax ¡in ¡C ¡

  3. Pointers ¡ • What ¡is ¡a ¡pointer? ¡ – declara@on, ¡&, ¡dereference ¡... ¡ • Pointer ¡& ¡dynamic ¡memory ¡alloca@on ¡ – Virtual ¡memory ¡ • Pointer ¡& ¡arrays ¡ – Rela@onship ¡between ¡pointer ¡and ¡array ¡name ¡ – sizeof, ¡strlen... ¡ • Pointer ¡arithme@c ¡ – *(array_ptr++) ¡and ¡(*array_ptr)++ ¡ ¡ – [] ¡and ¡* ¡ – pointers ¡to ¡arrays ¡and ¡array ¡of ¡pointers ¡

  4. Pointers ¡ • Pointer ¡& ¡func@ons ¡ – passing ¡by ¡value ¡& ¡passing ¡by ¡reference ¡ – func@on ¡pointers ¡ • Pointer ¡& ¡structures ¡ • Struct ¡declara@on ¡and ¡defini@on ¡ – #define ¡and ¡typedef ¡ – access ¡struct ¡with ¡pointers ¡ – offsetof ¡ ¡

  5. Introduc1on ¡to ¡Computer ¡Organiza1on ¡ • Three ¡layers ¡in ¡computer ¡system ¡ – soTware/os/hardware ¡ • Hardware ¡organiza@on ¡ – Von ¡Neumann ¡Architecture ¡ – virtual ¡memory ¡and ¡cache ¡hierarchy ¡ • What ¡will ¡happen ¡if ¡we ¡type ¡a ¡linux ¡command ¡ in ¡command ¡line? ¡

  6. Informa1on ¡Representa1on ¡ • Number ¡systems ¡ – Decimal, ¡Binary, ¡Hexadecimal, ¡Octal, ¡base-­‑10 ¡ • Two ¡important ¡limita@ons ¡ – Overflow, ¡accuracy ¡ • Informa@on ¡storage ¡and ¡byte ¡order ¡ – interpreta@on ¡is ¡important ¡ – word ¡size ¡ – byte ¡ – big ¡endian ¡and ¡li^le ¡endian ¡

  7. Integers ¡ • Why ¡low ¡level ¡representa@on? ¡ • B2U, ¡B2T, ¡B2O, ¡B2S ¡ – range ¡& ¡min, ¡max ¡ • Signed ¡vs. ¡unsigned ¡ • Integer ¡opera@ons ¡ – sign ¡extend, ¡trunca@on, ¡addi@on, ¡nega@on, ¡ mul@plica@on, ¡division ¡ – overflow, ¡mul@plica@on ¡by ¡constant, ¡division ¡by ¡power ¡ of ¡2, ¡rounding ¡ – shiT ¡and ¡bit ¡opera@ons ¡

  8. Floa1ng ¡Point ¡Numbers ¡ • Binary ¡floa@ng ¡point ¡ ¡ • IEEE-­‑754 ¡format ¡ – single ¡precision: ¡ ¡ • 1[31]-­‑sign, ¡8[30-­‑23]-­‑exponent, ¡23[22-­‑0]-­‑frac@on, ¡127-­‑bias ¡ ¡ • Normalized ¡& ¡special ¡values ¡ – 0, ¡subnormal ¡(de-­‑normalized), ¡+/-­‑infinity, ¡NaN ¡ – bias, ¡hidden ¡bit ¡ • Range ¡and ¡precision ¡ • Rounding, ¡cas@ng, ¡special ¡opera@ons ¡

  9. Exam ¡format ¡ • True ¡or ¡false ¡ – foo@cs ¡is ¡a ¡valid ¡variable ¡name ¡ • Mul@ple ¡choice ¡ – code ¡reading ¡and ¡basic ¡concepts ¡ – compiler ¡stages ¡ • Short ¡answer ¡ – code ¡reading/wri@ng ¡ – integer/ ¡float ¡point ¡number ¡calcula@on ¡ – IEEE754 ¡format ¡ • Code ¡evalua@on ¡ – code ¡reading, ¡explain ¡and ¡fill ¡in ¡blanks ¡ – find ¡bugs; ¡string ¡opera@on; ¡linked ¡list ¡opera@on ¡

  10. Sugges1ons ¡ • slides! ¡ • textbook! ¡ • Lab1 ¡& ¡HW1! ¡ • “reading ¡assignments” ¡and ¡“self-­‑study” ¡contents ¡ on ¡our ¡website ¡ • Prac@ce ¡problems ¡on ¡our ¡website ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend