Σχόλια#

Εισαγωγή#

Τα σχόλια στην C++ χρησιμοποιούνται για την προσθήκη επεξηγήσεων ή σημειώσεων μέσα στον κώδικα. Δεν επηρεάζουν τον τρόπο εκτέλεσης του κώδικα και είναι χρήσιμα για την αποσαφήνιση της λογικής, την τεκμηρίωση της λειτουργικότητας ή την προσωρινή απενεργοποίηση τμημάτων του κώδικα.

Comments#

A single-line comment starts with // and continues until the end of the line.

Examples
// 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.

Examples
/*
This project prints a greeting message,
followed by a farewell message
*/
printf("Hello!");
printf("Goodbye!");