Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6933037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:46:50+00:00 2026-05-27T11:46:50+00:00

I am trying to include a code example which contains a multi-line comment in

  • 0

I am trying to include a code example which contains a multi-line comment in Doxygen documentation. The problem is that the C++ preprocessor interprets the */ as the end of my Doxygen comment and therefore the syntax of the file is broken.

For example:

/*! \brief My Doxygen comment.
 *
 * \code
 * myFunction() /* Some multi-line comment */
 * \endcode
 */

I already tried the suggestion which works for JavaDoc comments: encode the slash using HTML entities like this:

* \code
* myFunction() /* Some multi-line comment */
* \endcode

but this doesn’t work (I guess because Doxygen does not replace HTML entities within code sections).

So the question is: is it possible to include multi-line comments in code example and how can it be done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:46:51+00:00Added an answer on May 27, 2026 at 11:46 am

    Use different comment styles.

    Instead of what you have, use:

    /// \brief My Doxygen comment.
    /// 
    /// \code
    /// myFunction() /* Some multi-line comment */
    /// \endcode
    ///
    

    The /// is the same as /*! and marks a doxygen portion. The pre-processor will treat each line as a single line comment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to compile example source code which is using the OpenGL, SDL
I'm trying to compile such code: #include <iostream> using namespace std; class CPosition {
I was trying to understand something with pointers, so I wrote this code: #include
I'm trying to write a blog post which includes a code segment inside a
I'm trying to include an image in an email, which is being sent using
I'm trying to include an EPS figure in a document that will be compiled
Update: Edited code example to use AutoA for the workaround (which was the original
I am trying to write a code that checkpoints multithreaded applications. Since fork function
I'm using Ubuntu 10.04 and I'm trying to run a WxRuby example which I
I'm creating a Maven archetype which generates a project skeleton that will include a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.