class: title # Functions ## CSC 161 – January 29, 2026 --- # Agenda for Today 1. Quiz 2. Department Events 3. Upcoming Work 4. Discussion 5. Lab 6. Wrap Up --- class: section green # Quiz --- # Department Events ## CS Extra: Major Declaration Information .indent[ Thursday, January 29th at 4pm in Noyce 3821 ] ## CS Table: User Interface Design .indent[ Tuesday, February 3rd at noon in JRC 224C ] --- class: section blue # Upcoming Work --- # Homework: Yahtzee **Due:** Thursday, February 12th (in two weeks) Let's look at the assignment now. --- class: section blue # Discussion --- # Discussion: Functions **Items for think, pair, share:** 1. What is the difference between a function declaration and a definition? 2. What are this functions parameters? What about its return type? ```c float foo(int a, float b); ``` 3. What is the value of `x` at the end of this code fragment? ```c int x = 1; increment(x); ``` Options: - `x` is `1` - `x` is `2` - We don't have enough information to know --- # Reading Questions Do you have any unanswered questions from the reading? --- class: section blue # Lab --- # Lab: Collaboration You should only be working on labs for this course when you are able to work with your assigned lab group. Let me know if you are having trouble getting members if your group to work with you, or if your partner(s) are working ahead without including you. --- class: section blue # Wrap Up --- # Wrap Up ## Lab Work You will need to submit your completed `rps.c` implementation with this week's lab report. The only version you need to submit is the one from the end of today's lab that uses functions. The new code style rules from last class are in effect for this lab report. The graders will make sure they see the submitted code on the `git` server, so make sure you commit and push changes by the time you submit. ## Reading - **Pointers -- Cower in Fear!** (Beej's Guide to C Programming, Chapter 5)