Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 1st, 2003, 10:10 AM
Authorized User
 
Join Date: Aug 2003
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing a const reference in C#.NET

How can you pass an object by constant reference to a function/procedure in C#.NET

Thanks in advance

 
Old October 1st, 2003, 10:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well you could do something like this...
Code:
public void someFunction(ref Object someObject)
{
   'some code.
}
And when you are passing a variable to the function you should preceed it with the 'ref' keyword aswell. You might like to check out the 'out' keyword too.

Hope it helps

Jacob.

 
Old December 21st, 2004, 06:48 PM
Registered User
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

LOL. texasraven, let me know if you find this out. I'm wondering the same thing. I might have to flame Microsoft's C# listserv, if C# doesn't have this ability. See my other post to planoie. :^)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing by reference quiksilverhg Excel VBA 5 November 21st, 2005 03:49 AM
Passing clas by reference ThunderBird Visual C++ 5 August 6th, 2004 06:26 AM
Passing a class by reference James Diamond VB How-To 13 February 16th, 2004 06:07 AM
Passing Reference Types by Value semiloof VS.NET 2002/2003 1 December 22nd, 2003 12:16 AM
Passing by reference jacob ASP.NET 1.0 and 1.1 Basics 1 July 12th, 2003 05:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.