Can structures be passed to the functions by value?

Discussion in 'C Programming' started by srinivasaraokoneru@gmail.com, Oct 12, 2005.

  1. Guest

    Can structures be passed to the functions by value?
     
    , Oct 12, 2005
    #1
    1. Advertising

  2. pemo Guest

    <> wrote in message
    news:...
    > Can structures be passed to the functions by value?
    >


    Yup
     
    pemo, Oct 12, 2005
    #2
    1. Advertising

  3. a écrit :
    > Can structures be passed to the functions by value?
    >

    Yes, but it's just another waste of time an memory...
     
    Emmanuel Delahaye, Oct 12, 2005
    #3
  4. a écrit :
    > Can structures be passed to the functions by value?
    >

    Yes, but it's just another waste of time and memory...
     
    Emmanuel Delahaye, Oct 12, 2005
    #4
  5. Emmanuel Delahaye wrote:
    > a écrit :
    >
    >> Can structures be passed to the functions by value?
    >>

    > Yes, but it's just another waste of time and memory...


    Uh, that would depend on what you need to do with it.
     
    =?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=, Oct 12, 2005
    #5
  6. Ben Pfaff Guest

    writes:

    > Can structures be passed to the functions by value?


    Yes. However, a constant pointer to a structure often saves
    memory and may save time.
    --
    "When I have to rely on inadequacy, I prefer it to be my own."
    --Richard Heathfield
     
    Ben Pfaff, Oct 12, 2005
    #6
  7. In article <>,
    Ben Pfaff <> wrote:

    >> Can structures be passed to the functions by value?


    >Yes. However, a constant pointer to a structure often saves
    >memory and may save time.


    The reverse may also be true. Small structures are often passed in
    registers.

    -- Richard
     
    Richard Tobin, Oct 12, 2005
    #7
  8. Ben Pfaff Guest

    (Richard Tobin) writes:

    > In article <>,
    > Ben Pfaff <> wrote:
    >
    >>> Can structures be passed to the functions by value?

    >
    >>Yes. However, a constant pointer to a structure often saves
    >>memory and may save time.

    >
    > The reverse may also be true. Small structures are often passed in
    > registers.


    Yes, this is true. I should have qualified my statement with
    "sufficiently large". Of course, nothing is guaranteed in any
    case.
    --
    Here's a tip: null pointers don't have to be *dull* pointers!
     
    Ben Pfaff, Oct 12, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dee
    Replies:
    9
    Views:
    540
    Joseph Byrns
    Apr 15, 2005
  2. Anand
    Replies:
    2
    Views:
    937
    Anand
    Sep 11, 2003
  3. LaundroMat
    Replies:
    50
    Views:
    984
    Hendrik van Rooyen
    Oct 14, 2006
  4. Alfonso Morra
    Replies:
    11
    Views:
    754
    Emmanuel Delahaye
    Sep 24, 2005
  5. naveen
    Replies:
    1
    Views:
    296
Loading...

Share This Page