CS 61C Quiz - Week 1-2, Wednesday

Current time: Tue Feb 11 09:18:38 2025

Deadline: Wed Jun 23 11:00:00 2004

Name:
SID:
Login:cs61c-

Question 1:

1. Complete the program segment below so that the contents of intPtr
and n before return agree with the diagram. 
intPtr     n
+---+    +---+
| *-|--->| 5 |
+---+    +---+

int main ( ) {
    ____ intPtr;
    ____ n;
    intPtr = ____ ;
    n = ____ ;
    return 0;
}

Question 2:

2. Write a void function named setTo5 that initializes the value of an
int variable used in the calling program to 5. Here's a framework for
a main program in which setTo5 is used: 
  #include 
  int main ( ) {
      int n = 27;
      setTo5 (/* an appropriate argument goes here */);
      printf ("n = %d\n", n);  /* should print n = 5 */
      return 0;
  }

Question 3:

What did you find difficult or confusing about the reading? If nothing was
difficult or confusing, tell us what you found mostinteresting. Please be as
specific as possible.

Send a confirmation email to my class account.