评论#

介绍#

C++ 中的注释用于在代码中添加解释或说明。它们不会影响代码的运行方式,并且有助于阐明逻辑、记录功能或暂时禁用部分代码。

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!");
}