New in C ++ playing with CodeBlocks
Using Code :: Blocks IDE for Mac in my C ++ class, I spend some time trying to clean up my first lab with comments and the like, and syntax highlighting warned me of something that I can't find documentation on the internet ...
/**
Author: Name
Lab1
Purpose: simulate a calculator with informative menu
*/
has a different backlight color than just
/*
What I thought
a normal multiline comment
was...
*/
and even still from
// Models a basic calculator with looping menu until sentinel or invalid operator is given
I am wondering what is the purpose / function for the first piece of code. In Java, this is docstring. Does this serve the same purpose in C ++? If not, what is it and how is it commonly used?
source to share
The first is a comment that Doxygen will recognize as documentation. Doxygen is modeled after Javadoc. And it's pretty popular, so it's no surprise that Code :: Blocks recognizes it. Doxygen can generate output in a wide variety of formats, including straight HTML that can be viewed with a web browser.
I don't know why he decided that the second and third examples should be of a different color. Maybe because one is a block comment and the other is a "to the end of line" comment. But to me this seems like a somewhat trivial difference.
source to share