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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:49:17+00:00 2026-06-13T21:49:17+00:00

I got this question on my exam In a passing parameter, during a function

  • 0

I got this question on my exam

In a passing parameter, during a function call, the parameters are copied => call to the copy constructor for each parameter. Suppose a List is passed as a parameter, all the elements of the list are copied. If it is a reference to a list, only the address of the list is copied. What’s your say about those statements?

My answer was “If it is a reference to a list, not only the address is copied but also the value” and I got 5 out of 10 point.
Did I my answer wrong? For me, that’s what I got. Does the statement above correct?

  • 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-06-13T21:49:18+00:00Added an answer on June 13, 2026 at 9:49 pm

    If you pass by reference, a copy of the object is not made. That’s the difference between passing by reference and passing by value.

    Under the hood, references are implemented as pointers, so you can say the address is copied, but that’s an implementation detail.

    The formulation though is wrong:

    Suppose a List is passed as a parameter, all the elements of the list are copied. If it is a reference to a list, only the address of the list is copied.

    It doesn’t matter if you pass a list or a reference to a list. What matters is how the method takes parameters – either by value or by reference:

    void foo(list l);
    void goo(list& l);
    
    list x;
    list& y = x;
    
    foo(x);  //pass a list by value          --copy is made
    foo(y);  //pass a reference by value     --copy is made
    
    goo(x);  //pass a list by reference      --no copy of the list
    goo(y);  //pass a reference by reference --no copy of the list
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Preparing for exam and got stuck at this question: Allowed operators are <<,+,& no
I got this question from this discussion . A method call like object.m does
I got this question in a Cisco interview: write a function to find the
Here's a question I got in an exam today: In C, suppose the pointers
I got this question from my cousin: What will be the best way to
I got this question in a programming test. Do you think this question is
Today I got this question for which I think I answered very bad. I
I just got this question on an interview and had no idea how to
So I got this question in data structures class' homework, I'm translating so I
Based on feedback I got from this question , I'm interested in using Lazy

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.