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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:02:12+00:00 2026-06-04T23:02:12+00:00

I would just like to confirm that when I have a function of the

  • 0

I would just like to confirm that when I have a function of the sort

int subtract(int a, int b)
{
return a-b;
}

I am passing values when i call subtract(3,2) rather than pointers.

Thanks,

  • 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-04T23:02:14+00:00Added an answer on June 4, 2026 at 11:02 pm

    Yes you are

    • a parameter of type int a means pass an integer by value to the function
    • a parameter of type int* a means pass a a pointer to some integer to the function.

    so for this

    int subtract(int a, int b) 
    { 
       // even if I change a or b  in here - the caller will never know about it....
       return a-b; 
    } 
    

    you call like this:

    int result  = substract(2, 1); // note passing values
    

    for pointers

    int subtract(int *a, int *b) 
    { 
       // if I change the contents of where a or b point the  - the caller will know about it....
       // if I say *a = 99;  then x becomes 99 in the caller (*a means the contents of what 'a' points to)
       return *a - *b; 
    } 
    

    you call like this:

    int x = 2;
    int y = 1;
    int result  = substract(&x, &y); // '&x means the address of x' or 'a pointer to x'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just want to confirm that I have this correct, and would like to see
I would just like your feedback on something. Basically I have a value called
I have an std::vector<unsigned char> with binary data in. I just would like to
I can't confirm that this syntax is best practice. I would like to reference
I have a recursive function (in C#) that I need to call about 800
I would just like to know if there is any advantage to having a
I am new to coding and would just like to know a bit more
I'm debugging multi-threaded code and I would just like to know if a line
Is there anything like this outside of the application delegate? I would just like
I am pretty sure I cannot, but I would just like to double check

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.