Not logged in. Login

Helpful C++ Files

Download copies of these files to your computer:

  • hello_world.cpp: A sample program to test that you've got your environment up and running. See here for how to compile and run it.
  • makefile: This stores all the compiler options we are using with g++ in this course. Put a copy of makefile in every folder you compile C++ files in.
  • cmpt_error.h: Contains the helper function cmpt::error("...") that intentionally crashes a program with a (hopefully!) helpful error message.
  • cmpt_trace.h: Contains the Trace helper class that prints a message when a function is called and when it returns. It is especially helpful for understanding recursive functions. See the comments in cmpt_trace.h for an example of how to use it.
Updated Sun Jan. 05 2025, 17:07 by hskhangu.