Comments#

Introduction#

Comments in C++ are used to add explanations or notes within the code. They do not affect how the code runs and are useful for clarifying logic, documenting functionality, or temporarily disabling parts of the code.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();
  // This is a single-line comment
  // Print a greeting message
  Brain.Screen.print("Hello!");
}

Multiline Comments#

Multiline comments in C++ use /* and */ to mark the beginning and end of the comment block.

int main() {
  // Initializing Robot Configuration. DO NOT REMOVE!
  vexcodeInit();
  /*
  This project prints a greeting message,
  followed by a farewell message on the
  screen.
  */
  Brain.Screen.print("Hello!");
  Brain.Screen.newLine();
  Brain.Screen.print("Goodbye!");
}