[Home]

CS 223 - Spring 2017. 2/20

Welcome to CS 223!

Logical problem of the day

lp0220.c
#include 

struct circ_list
{
  char    value[ 3 ];     /* e.g., "st" (incl '\0') */
  struct circ_list        *next;
};

struct circ_list    suffixes[] = {
  "th", & suffixes[ 1 ], /* 0th */
  "st", & suffixes[ 2 ], /* 1st */
  "nd", & suffixes[ 3 ], /* 2nd */
  "rd", & suffixes[ 4 ], /* 3rd */
  "th", & suffixes[ 5 ], /* 4th */
  "th", & suffixes[ 6 ], /* 5th */
  "th", & suffixes[ 7 ], /* 6th */
  "th", & suffixes[ 8 ], /* 7th */
  "th", & suffixes[ 9 ], /* 8th */
  "th", & suffixes[ 0 ], /* 9th */
};

#define MAX 20

int main()
{
  int i = 0;
  struct circ_list    *p = suffixes;
  while (i <= MAX) 
    {
      printf( "%d%s\n", i, p->value );
      ++i;
      p = p->next;
    }
  return 0;
}
Above is an example of a (useful) circular list. What the hell is going on?

Lecture 11: Introduction to C: valgrind, hash tables, midterm review

Administrivia

  • Office hours:
    The office hours are Sun/Tue/Thu 8-11 PM at Hillhouse 17 Rm 111.
  • My office hours this week are Wednesday 3-5pm.

  • Recovering deleted files on the zoo (per student inquiry)
    Generally, files are backed up daily, usually overnight. If you accidentally delete a file, you can probably recover it from backup, but it would not include any changes you made since the previous night's back up.

    A better approach is to use version control, like git. Or to alias the rm command to move your files to a trash directory.

  • FLOAT study groups today at 4pm:
    CPSC 201 and 223 Study Groups Monday, Feb 20, 4-6pm, Digital Humanities Lab (Sterling Memorial Library Room 316)

    If you are in CPSC 201 or 223 and are having trouble studying for your upcoming midterms, this event is for you. Float is holding study groups for these two classes in the Digital Humanities Lab (Sterling Memorial Library room 316) from 4-6pm this Monday, Feb. 20th. Come work with your peers and ace this test!

    Lecture Starts Here

    midterm review

    Midterm exam Wednesday February 22nd in class. topics

    Sample solutions to practice questions


    [Home]