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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:01:49+00:00 2026-05-15T16:01:49+00:00

I have an exam on C++ coming up, and I’m solving a few ones

  • 0

I have an exam on C++ coming up, and I’m solving a few ones from past years. I have this question in one of them:

A function calculates the volume of a
prysm. Arguments passed are height,
depth and width. Arguments and return value are doubles
Depth is optional and
should default to 10.
Hypothesis 1:
All parameters are passed by value

I answered double volume_prysm(const double width, const double height, const double depth = 10);

Hypothesis 2:
All parameters are passed by reference

How can I define a reference parameter in order for it to default to 10?

Thanks for your time!

PS: Sorry y’all for not translating

  • 1 1 Answer
  • 3 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-15T16:01:50+00:00Added an answer on May 15, 2026 at 4:01 pm

    I don’t know if that is what the question was aiming at, but temporaries can be bound to const references:

    double volume_prisma(const double& largura, ..., const double& depth = 10);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Introduction I have a question coming from this one: Loop calling an asynchronous function
I found this exam question that I have to tell how the beq instruction
This is a scjp mock exam question. Suppose I have the following two files:
I have a university programming exam coming up, and one section is on unicode.
I have some question from the exam in which I need to deduce the
this is really hard question. I have an exam. And questions will be like
I have this question on a practise exam, and have no idea how to
so i have my programming exam this winter and one of my assignments is
Hi all I have an exam coming up and am not getting much help
I have an exam tomorrow and I was trying to understand this doubly linked

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.