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 7570855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:31:21+00:00 2026-05-30T15:31:21+00:00

I want to improve the readability of the code. So I commented the parameter’s

  • 0

I want to improve the readability of the code. So I commented the parameter’s direction in the code like this:

#define IN
#define OUT

void Add(IN int Para1, IN int Para2, OUT int& Result);

But I think the compiler will replace every instance of IN and OUT with blank and it could be quite a problem some times.

So is there a better way? Thanks.

(I use C++.)

  • 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-30T15:31:23+00:00Added an answer on May 30, 2026 at 3:31 pm

    Yes: Forget those things and use constness. That will work as long as you don’t have a “in” and “out” parameter, which is and should be rarely used.

    void foo(int i, const std::string& s, std::vector<char>& out_buf);
    // i and s are obviously "in" variables, while out_buf could be both, 
    // but you can easily show that by giving the parameter a proper name.
    

    Edit:
    And const correctness does not mean to make value parameters const! This doesn’t give the caller any additional information at all, since you can’t change his variables either way.

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

Sidebar

Related Questions

I want to improve this code http://jsfiddle.net/QmTNZ/30/ to use comma separated price in place
This days I'm refactoring code and one of the things I want to improve
Looking to improve my IF statement, and I want to keep my code looking
I want your suggestion on the following pseudo-code. Please suggest how could I improve
So first here is some pseudo code of what I want to improve. public
I need to append a lot of HTML code. To improve readability, I don't
I'm trying to improve performance of my script. I want to improve this: el.removeClass(
I want to improve current implementation of the ASP.NET MVC Framework. Current code: routes.MapRoute(null,
I am porting an existing application to C# and want to improve performance wherever
I work on the JBJF Project on SourceForge and we want to improve on

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.