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

  • Home
  • SEARCH
  • 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 6669149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:07:00+00:00 2026-05-26T03:07:00+00:00

What is the difference between \param[out] and \return in Doxygen? They both seem to

  • 0

What is the difference between \param[out] and \return in Doxygen? They both seem to document the output / return of a function. Is the difference due to void functions which don’t have a return value and only param[out] would be valid?

  • 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-26T03:07:01+00:00Added an answer on May 26, 2026 at 3:07 am

    Out parameters are different from return values. Take this example in C:

    /**
     * \param[in]  val      Value calculations are based off.
     * \param[out] variable Function output is written to this variable.
     *
     * \return Nothing
     */
    void modify_value(int val, int *variable)
    {
        val *= 5;
        int working = val % 44;
        *variable = working;
    }
    

    The function returns nothing, but the value to which variable points is changed, hence we call it an output parameter. It represents an ‘output’ of the function in that we expect it to be modified somehow by the function. val, on the other hand, is an ‘input’ parameter because it is not modified (and, indeed, cannot be modified from the perspective of the function’s caller, since it is passed as a value).

    Here’s a slightly more useful and realistic example:

    typedef struct data {
        int i;
        int j;
        ...
    } data;
    
    /**
     * \param[in]  val Initialising parameter for data.
     * \param[out] dat Data pointer where the new object should be stored.
     *
     * \return True if the object was created, false if not
     *         (i.e., we're out of memory)
     */
    bool create_data(int val, data **dat)
    {
        data *newdata;
        newdata = (data*)malloc(sizeof(data));
        if(newdata == NULL)
        {
            *dat = NULL;
            return false;
        }
        newdata->i = val;
        *dat = newdata;
        return true;
    }
    

    In this case, we construct some complex object inside the function. We return a simple status flag that lets the user know the object creation was successful. But we pass out the newly-created object using an out parameter.

    (Although, of course, this function could easily just return a pointer. Some functions are more complex!)

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

Sidebar

Related Questions

Is there any difference between int on_exit(void (*function)(int , void *), void *arg); and
I have a joinable pthread runner function defined as below: void *sumOfProducts(void *param) {
I have this method for figuring out the difference between 2 0-360 compass headings.
Possible Duplicate: C++ Why put void in params? What's the difference between these two
Difference between a bus error and a segmentation fault? Can it happen that a
The difference between Chr and Char when used in converting types is that one
What is the difference between early and late binding?
Is there a performance difference between i++ and ++i if the resulting value is
What is actually the difference between these two casts? SomeClass sc = (SomeClass)SomeObject; SomeClass
What is the difference between TrueType fonts and Type-1 fonts?

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.