Comentarios#
Introducción#
Los comentarios en C++ se utilizan para añadir explicaciones o notas dentro del código. No afectan la ejecución del código y son útiles para aclarar la lógica, documentar la funcionalidad o deshabilitar temporalmente partes del código.
Comments#
A single-line comment starts with // and continues until the end of the line.
// This is a single-line comment
printf("Hello!"); // Print a greeting message
// Print a greeting and then a farewell
printf("Hello!");
printf("Goodbye!");
Multiline Comments#
C++ uses block comments (/* … */) for multi-line explanations. These are true comments and are ignored by the compiler.
/*
This project prints a greeting message,
followed by a farewell message
*/
printf("Hello!");
printf("Goodbye!");