|
-
July 13th, 2009, 05:47 AM
#9
Re: string in Stack or Heap ?
 Originally Posted by dannystommen
if you want to pass a reference as paramater, you need to add the 'ref' modifier.
Code:
public static void swap(ref string s1, ref string s2)
{
...
}
Strings are reference types so you don't 'copy' them by passing them to anther function. The ref parameters are unnecessary for this case.
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|