Thread: Definition of "Calling" ?

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    182

    Definition of "Calling" ?

    According to my book there are two ways to pass arguments to a function. Call by value, and call by reference.

    QUESTION: Could someone give me a precise definition of calling to me? What is calling what?

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    It's actually pass by value or by reference. The function is being called regardless. It's a matter of how the argument is being passed.

    Basically you're passing a number to a function, it just depends what kind of number you're passing. If you pass an int, then the function will receive the value of the int, a copy of the int, so to speak. If you pass the address of the int, then you're passing the integer by reference, and a copy of the value of the address is given. This means changes to the value that the pointer points to will be reflected in the calling function as well.

    There are many examples of this.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    182
    Ahh, that's what I thought before the book confused me.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  3. DLL compiling question
    By Noose in forum Windows Programming
    Replies: 2
    Last Post: 12-16-2004, 07:16 AM
  4. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM
  5. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM