Click here to Skip to main content
16,004,974 members
Home / Discussions / C#
   

C#

 
Generallmao Pin
Ennis Ray Lynch, Jr.4-Oct-08 9:44
Ennis Ray Lynch, Jr.4-Oct-08 9:44 
GeneralRe: lmao Pin
Guffa4-Oct-08 10:31
Guffa4-Oct-08 10:31 
GeneralRe: lmao Pin
Ennis Ray Lynch, Jr.4-Oct-08 10:47
Ennis Ray Lynch, Jr.4-Oct-08 10:47 
GeneralRe: lmao Pin
Guffa4-Oct-08 13:54
Guffa4-Oct-08 13:54 
GeneralRe: lmao Pin
S. Senthil Kumar4-Oct-08 19:42
S. Senthil Kumar4-Oct-08 19:42 
GeneralRe: lmao Pin
Guffa5-Oct-08 2:07
Guffa5-Oct-08 2:07 
GeneralRe: lmao Pin
S. Senthil Kumar5-Oct-08 17:49
S. Senthil Kumar5-Oct-08 17:49 
GeneralRe: lmao Pin
Guffa5-Oct-08 23:26
Guffa5-Oct-08 23:26 
S. Senthil Kumar wrote:
Well, than can you write a snippet of code that demonstrates passing by reference?


Well, that's easy:
void GetAnswer(ref string answer) {
   answer = "42";
}

string answer = null;
GetAnswer(ref answer);

S. Senthil Kumar wrote:
Because I can't see how *anything* can be passed by reference at all - ultimately, an address would have to pushed on to the stack and popped at the other end.


Then you don't understand the concept of passing by reference. Usually a pointer or reference is passed on the stack, but it doesn't have to be implemented that way. The specification only says that the value of the variable will be updated when the control passes back to the calling method, so the value of the variable could actually be passed back and forth instead of a passing a pointer to the variable.

Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: lmao Pin
S. Senthil Kumar5-Oct-08 23:36
S. Senthil Kumar5-Oct-08 23:36 
AnswerRe: ref and out Pin
Guffa3-Oct-08 5:56
Guffa3-Oct-08 5:56 
Questionwindows service-uninstall Pin
arkiboys3-Oct-08 1:25
arkiboys3-Oct-08 1:25 
AnswerRe: windows service-uninstall Pin
Ashfield3-Oct-08 1:31
Ashfield3-Oct-08 1:31 
GeneralRe: windows service-uninstall Pin
arkiboys3-Oct-08 1:53
arkiboys3-Oct-08 1:53 
AnswerRe: windows service-uninstall Pin
Brij3-Oct-08 1:45
mentorBrij3-Oct-08 1:45 
GeneralRe: windows service-uninstall Pin
arkiboys3-Oct-08 1:55
arkiboys3-Oct-08 1:55 
GeneralRe: windows service-uninstall Pin
arkiboys3-Oct-08 2:40
arkiboys3-Oct-08 2:40 
QuestionRe: windows service-uninstall Pin
led mike3-Oct-08 4:29
led mike3-Oct-08 4:29 
AnswerRe: windows service-uninstall Pin
arkiboys3-Oct-08 4:55
arkiboys3-Oct-08 4:55 
QuestionThe parameter is incorrect Pin
NiloofarNoroozi3-Oct-08 1:23
NiloofarNoroozi3-Oct-08 1:23 
QuestionRe: The parameter is incorrect Pin
Alan Balkany3-Oct-08 3:51
Alan Balkany3-Oct-08 3:51 
AnswerRe: The parameter is incorrect Pin
NiloofarNoroozi3-Oct-08 9:33
NiloofarNoroozi3-Oct-08 9:33 
GeneralRe: The parameter is incorrect Pin
Alan Balkany3-Oct-08 9:37
Alan Balkany3-Oct-08 9:37 
GeneralRe: The parameter is incorrect Pin
NiloofarNoroozi3-Oct-08 18:50
NiloofarNoroozi3-Oct-08 18:50 
GeneralRe: The parameter is incorrect Pin
Alan Balkany6-Oct-08 3:12
Alan Balkany6-Oct-08 3:12 
QuestionList Directories inside TreeView control. Pin
jas0n233-Oct-08 1:18
jas0n233-Oct-08 1:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.