Skip to main content

Lecture Notes: 05 Arrays

··1 min

Longest Word #

  • Plan:
    • Read /usr/share/dict/words into an array.
    • Make an array of lengths.
    • index of longest
    • We’ll use malloc for everything
  • Makefile first.
    • gcc command
    • clean rule
    • tabs
  • Get distracted by:
    • Standard library functions and headers:
      • stdio.h: printf, fscanf, fgets
      • stdlib.h: atol
      • math.h: ceil, sqrt – show manpage, talk about libm
    • Casts. For numbers, these convert.