Skip to content

Formatting Code

Valerie Wong edited this page Aug 27, 2022 · 1 revision

Use the following command to format your code:

clang-format

A .h file is a header file where you only declare your functions, classes, and variables. There should be no implementations in this file. Header files are useful for many reasons such as:

  • Providing a summary form of the code that is easily read and understood
  • Allows compilation of code based on header definitions, even if the implementation code is not written yet
  • Reduces lines of code as well as complexity

A .cpp file is where you define the previously declared symbols - methods, static variables, and other functions. This file will have implementations.

Clone this wiki locally