Review Questions for Intermediate C class

Class 1 (C Review)

  1. What is main?
  2. What are the 2 steps to go from a .c file to a .exe file?
  3. What does static mean in front of a local variable?
  4. What does static mean in front of a function?
  5. What do break and continue do?
  6. What is a pointer?
  7. What is the name of an array?
  8. If p is a pointer, what's the difference between p[i]=0; and *(p+i)=0;?
  9. What do malloc, calloc, realloc, strdup, and free do?

Class 2 (C Review)

  1. Describe the difference between malloc and calloc
  2. realloc has the ability to act like what 2 other functions, based on it's parameters?
  3. Name and describe at least 5 I/O functions (i.e., fopen)
  4. Describe the processing differences between a text- and binary-mode file.
  5. Can a called function modify a local variable of the calling functions?
  6. How do you accomplish the above?
  7. Whats the difference between return and exit?

Class 3 (Structures, recursion)

  1. Describe Recursion
  2. How does recursion differ from looping?
  3. Whats the 'rule of thumb' to determine when to use recursion?
  4. How do you access a member of structure?
  5. How do you access the member of a pointer to a structure?
  6. Can structures contain other structures?
  7. Can they contain themselves? (Any more details?)

Class 4 (Stacks and Screen Painting)

  1. What is a stack?
  2. How would you implement a structure for a stack?
  3. What is the purpose of each member of the stack structure?
  4. What are the basic operations of the stack?
  5. What do C and other languages uses the system stack for?

Class 5 (Reviewed Stack, Field editing/Project)

  1. What is the purpose of the FIELD structure?
  2. Describe the meaning of each FIELD member.
  3. How are the Dest and Label FIELD members initialized?
  4. How do you create an array of FIELD structures.
  5. Why would you create an array of FIELD structures?

 

Class 6 (Queues)

  1. What is a Queue?
  2. How would you implement a Queue, using a C struct?
  3. What is the purpose of each member in the queue struct?
  4. How does a queue differ from a stack?
  5. What similarities do the queue and stack share, from a programmers standpoint?

 

Class 7 (Linked Lists)

  1. What is a NODE?
  2. How does a doubly-linked list differ from a singly-linked list?
  3. How would you define a NODE struct in C?
  4. What is the purpose of each data member in the NODE struct?
  5. How would you iterate through all NODEs in a list?