Tools like Doxygen allow developers to generate documentation from specially formatted comments. These comments often use tags like @param, @return, and @brief.
/**
* @brief Calculates the square of a number.
* @param x The number to be squared.
* @return The square of x.
*/
int square(int x) {
return x * x;
}