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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:26:47+00:00 2026-05-29T19:26:47+00:00

What are all the possible types of valid expressions for a default argument in

  • 0

What are all the possible types of valid expressions for a default argument in a function or member function?

  • 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-29T19:26:52+00:00Added an answer on May 29, 2026 at 7:26 pm

    Anything that is correct within context of assignment to a variable of function parameter’s type.

    Edit
    The default arguments during compilation are evaluated in terms of type correctness etc, but they are not calculated and no assignment takes place until run-time. You can specify a constructor of a yet to be defined class as a default argument and it’s fine, as long as class is defined at the point of function use… The actual calculation/assignment takes place during function call, not at the point of function declaration/definition.

    Example:

    #include <iostream>
    
    void foo( int a = std::rand())
    {
      std::cout << a << std::endl;
    }
    
    int main( void )
    {
     foo();
    
     return( 0 );
    }
    

    Program output on ideone.com:

    1804289383

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

Sidebar

Related Questions

Is it at all possible to use javascript server side and thus not shown
Is it at all possible to do database-agnostic table dumps/hydrates? I don't have any
Is the following at all possible in c#? I have the following but the
Algorithm to generate all possible letter combinations of given string down to 2 letters
I need to separate all possible suffixes (about 1000) from a given word. I
IS it at all possible to set the Google homepage to a file located
Possible Duplicate: Python code to pick out all possible combinations from a list? I
I tried setting all possible styles to something other than grey, just to try
Trying to get a list of all possible combinations of 2 arrays passed in
Is there a place to find all possible uses of the syscmd method in

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.