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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:35:52+00:00 2026-05-27T04:35:52+00:00

I know that the question when pointer and when reference or pass an argument

  • 0

I know that the question “when pointer and when reference” or “pass an argument in function by reference or pass by pointer” has been asked numerous times. However, I have the impression that in a few occasions I have read: “You should pass an Object to a function by pointer when you want to modify it”. Could someone say, explain and justify if the last sentence is entirely correct?

Or in other words, isn’t it possible to modify an object through a reference?

  • 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-27T04:35:53+00:00Added an answer on May 27, 2026 at 4:35 am

    You should pass an object as a double pointer if you want to change what the pointer points to, for example when moving the object from one memory location to another:

    void foo (obj **x) {
      delete *x;
      obj *y = (obj *) some_new_address;
      *x = y; // change what x points to
    }
    ...
    obj *x = new obj();
    foo(&obj);
    // obj now points to another location
    

    With a reference you can’t do that.

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

Sidebar

Related Questions

I know that this question is asked a lot, I checked all of the
I know that my question will be very similar to other ones already asked
Ok, I know that question is not very informative.. Someome feel free to change
I know that that is not a question... erm anyway HERE is the question.
I know that this is a simple question for PHP guys but I don't
Firstly I know that there are many question and solutions to correct thread marshalling
this is my first question here :) I know that I should not check
A recent question about string literals in .NET caught my eye. I know that
This is just a curiosity question. I know that Spring can be used in
This is just a feasibility question. I know that if I say int myInt

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.