CS 330 Lecture 25 – Concrete Classes in C++
Agenda what ?s classes in C++ namespaces RAII references overloading builtin operators I/O of custom types Code Image.h Image.cpp main.cpp Haiku
CS 330 Timbre Homework – due before April 15
See the PDF.
CS 330 Lecture 24 – Memory, Polymorphism, and Higher-order Functions
Agenda what ?s program this polymorphism in C function pointers callbacks with GLUT TODO 1/4 sheet: read A Malloc Tutorial. Program This Write a preprocessor macro named EZMALLOC that shortens the code needed to allocate a block of memory. Programmers will invoke it with something like: Code multireturn.c poly.c torus.c Haiku
CS 330 Lecture 23 – Cisms Cont’d
Agenda what ?s enums and type safety the C preprocessor macro danger dynamic memory allocation memory allocation When do I dynamically allocate memory? When you don’t know how much memory you’ll need at compile time. You don’t know if the size depends on a function parameter. When you allocate memory within a function but need the […]
CS 330 Lecture 22 – Cisms
Agenda what ?s exams Cisms types sizeof headers dynamic memory allocation addressable memory polymorphism Code sizes.cpp blackjack.c Haiku
CS 330 Lecture 21 – Languages Working Together
Agenda what ?s calling C++ from Java strings arrays TODO Start the Timbre homework. Code Main.java Logger.java native.cpp makefile Note to copy and pasters: makefile rules need to be indented with real tabs, not spaces. Main.java Imogene.java native.cpp native.cpp.ours makefile Note to copy and pasters: makefile rules need to be indented with real tabs, not […]
CS 330 Lecture 20 – Static vs. Dynamic
Agenda what ?s static vs. dynamic polymorphism in C enums in C enums in Java TODO Exam on Wednesday. Roughly, we’ve talked about the shell, regex, grammars, modeling programs with abstract syntax trees, assembly, and types. On Friday, we’ll be discussing JNI, which will be used in the next homework. Code charAt.html Haiku
CS 330 Lecture 19 – A Type Dichotomy
Agenda what ?s system vs. programmer-defined strong vs. weak static vs. dynamic TODO For a 1/4 sheet participation point, compose a midterm question about some topic we’ve discussed so far this semester. Follow these guidelines in forming your question: The question should require cognitive processes to answer. Merely recalling trivia does not. You can look […]
CS 330 Lecture 18 – Types
Agenda what ?s program this a definition of types static vs. dynamic weak vs. strong Program This Write pseudocode to calculate a score for a given hand in Black Jack. In this game, jacks, queens, and kings are worth 10, numeric cards (2-9) are worth their numeric value, and aces are worth either 1 or […]
CS 330 Lecture 17 – On to C
Agenda what ?s program this think about this C over assembly TODO Read The Descent to C. 1/4 sheet. Program This Write atoi, which converts a C string into an integer. Think About This Imagine you are an assembly language programmer in the 1970s. What’s one gripe you have with assembly? Haiku