TOPICS FOR THE COP 3223H EXAM on C Programming with Pointers and Structs $Date: 2019/04/19 13:00:09 $ This exam covers topics from homeworks 6-7. It is related to the course outcome [Programming]. REMINDERS This exam is closed book and notes. If you need more space, use the back of a page. Note when you do that on the front. Before you begin, please take a moment to look over the entire test so that you can budget your time. Clarity is important; if your answers are sloppy and hard to read, you may lose some points. READINGS We recommend reading the materials referred to in the course syllabus. In particular the following: * Arup Guha. Programming Knights: An Introduction to Computer Programming in Python and C, Pearson Learning Solutions, 2013. Chapters 14-17. * See also the code examples page: http://www.cs.ucf.edu/~leavens/COP3223H/examples/index.html Note that you can start by looking at a test file (test_f.c) and then program the function (f) yourself for practice. If you have time, you might also read * Alex Allain. C Tutorial, 2011. Online at http://www.cprogramming.com/tutorial/c-tutorial.html. Chapters 4,6,7,15 TOPICS In the following, I use + to denote relatively more important topics, and - to denote relatively less important topics. Topics marked with ++ are almost certain to be on the exam. All of these are fair game, but if you have limited time, concentrate on the ones that are more important first (and in those, the ones you are most uncertain about). SKILLS [Programming] ++ Write an entire (console) program in C (HW6: palindrome) ++ Write a C function that manipulates arrays and pointers (HW6: palindrome, ivec functions, interval functions) ++ Write C functions that work with C strings (HW6: palindrome; HW7: us_tele functions) ++ Write C functions that work with structs, pointers, and malloc (HW7: functions in us_tele) ++ Write C code that does input and output of data (HW7: palindrome, read_us_tele, us_tele_to_string) ++ Write C code that accesses and manipulates structs via pointers (HW7: area_code, digits, us_tele_to_string) - Write C code to manipulate linked lists CONCEPTS [Semantics] You should understand the following concepts and terms and be able to use them in solving problems. Note that you should have the syntax of the most useful parts of C memorized. ++ C arrays ++ types for pointers ++ meaning of the * operator for pointers, the address-of operator & ++ types of expressions involving pointers and their declarations ++ How strings are represented and manipulated in C ++ The equivalence between pointers and arrays in C + Assertions in C with libtap (i.e., tap.h and tap.c, ok(), etc.) ++ pointer types ++ const + parameter passing in C + lifetimes of storage: infinite vs. auto + avoiding dangling pointers with malloc ++ use of malloc + C modules: static vs. extern declarations + header files, #include, #define, #ifndef - separate compilation + information hiding and data abstraction - stepwise refinement + declarations and definitions in C ++ I/O in C: scanf and printf ++ prompting for and reading information from a user + formatting strings with sprintf ++ typedef ++ accessing fields of structs, accessing struct fields via pointers ++ sizeof and when (not) to use it