Results 1 to 2 of 2

Thread: arguments by reference

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    arguments by reference

    as i see that in c++ there is heavy use of pointers i got a question...would it be worth instead of passing in C# arguments by value pass them all or almost all as ref?
    \m/\m/

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    No. In C# all object are passed by reference by default. It only makes sense for parameters of large value structs (e.g. Rectangle). Small value structs shouldn't be passed as ref unless you want to modify them.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width