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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:38:14+00:00 2026-05-13T18:38:14+00:00

Please read before answering. I dont want you to state the obvious for me.

  • 0

Please read before answering. I dont want you to state the obvious for me. THANKS 😀

I am trying to differentiate between pointers and passing by value. And I think I understand them but one thing the source I was reading wasnt clear on is what is the difference between passing a pointer and passing by value. consider the following…

andy = 25;
fred = andy;
ted = &andy; 

The first line passes the value 25 to andy. The second line passes the value of andy to fred. Now fred possess the value 25. the third line passes reference to ted. Now ted holds the memory address of andy, which holds the value of 25. Now take a look at the next code

andy = 25;
fred = andy;
ted = &andy; 
joe = *andy;

The above code looks just like the first snippet except we pass the pointer of andy to joe. Now joe holds the pointer value of 25. Which almost seems the same as just doing (joe = andy). without *

what’s the difference in passing the pointer value compared to just passing by value ???

In my interpretation, It appears that the pointer value of joe is still affected if later down the line I decided to change the value of andy/ compared to if I just passed by value, it not be affect. T

To my knowledge, the only difference between passing by reference and passing by pointer is that one holds the address, and the other holds the value within that address. which can still change if any varible that holds that value reference, decides to change it. If this is the case, what is the significance of passing by reference and passing by value.

Here is the link to what I was reading

http://www.cplusplus.com/doc/tutorial/pointers/

Thanks guys!!!

  • 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-13T18:38:14+00:00Added an answer on May 13, 2026 at 6:38 pm

    You can’t do joe = *andy because andy isn’t a pointer, it’s an int.

    However, you could do joe = *ted, because ted is a pointer.

    Suppose you did this:

    andy = 25; 
    fred = andy; 
    ted = &andy;  
    joe = *ted;
    andy = 26;
    jim = *ted;
    

    Then joe will have a value of 25, while jim will have a value of 26.

    The reason for this is that ted is a pointer to andy. Using *ted gives you the value at that pointer, at that time.

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

Sidebar

Related Questions

EDIT: please read the question and why I want to do it before passing
(Please read at least this before answering: This is a temporary measure ! No,
Before jumping on me, please read my question carefully :D. I know there are
Hi all (before closing based on the title, please read the bottom parragraph), I'm
Guys before you start down voting me please read this question and please understand
Before someone shouts out the answer, please read the question through. What is the
Please read before tagging as duplicate . I'm creating a set of applications which
Please read edit 2 first thanks! I have been working on a page called
please read all of this before commenting. I'm currently working on a large website
Please don't close this question before read my actual problem. I have seen many

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.