Skip to main content
  1. /classes/
  2. Classes, Spring 2025/
  3. CS 2470 Spring 2025: Course Site/

Lecture Notes: 05 Arrays

·57 words·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.
Nat Tuck
Author
Nat Tuck