Click here to Skip to main content
15,891,607 members
Home / Discussions / C#
   

C#

 
GeneralRe: which way better for activation? Pin
OriginalGriff9-Oct-10 6:15
mveOriginalGriff9-Oct-10 6:15 
GeneralRe: which way better for activation? Pin
Luc Pattyn9-Oct-10 7:13
sitebuilderLuc Pattyn9-Oct-10 7:13 
GeneralRe: which way better for activation? Pin
OriginalGriff9-Oct-10 7:16
mveOriginalGriff9-Oct-10 7:16 
AnswerRe: which way better for activation? Pin
OriginalGriff9-Oct-10 6:19
mveOriginalGriff9-Oct-10 6:19 
QuestionAssign By Reference Pin
thenutz729-Oct-10 4:08
thenutz729-Oct-10 4:08 
AnswerRe: Assign By Reference Pin
PIEBALDconsult9-Oct-10 4:18
mvePIEBALDconsult9-Oct-10 4:18 
GeneralRe: Assign By Reference Pin
harold aptroot9-Oct-10 4:45
harold aptroot9-Oct-10 4:45 
AnswerRe: Assign By Reference [modified] Pin
Keith Barrow9-Oct-10 6:28
professionalKeith Barrow9-Oct-10 6:28 
thenutz72 wrote:
It's like you can have reference behaviour through functions that you cannot have WITHIN the function.


Pretty much everything is done by reference:

MyObject foo = new MyObject();


foo is a reference to the object created by the constructor. When it gets used it is automatically de-referenced, see this[^] for the c# boxing and unboxing model. When you pass an object to a method it is passed as a reference by default, you have to tell the method if you want it passed by value.

If you need pointers you have to use unmanagedunsafe code, where pointers are available, but in C# you rarely need it. I've being doing this for 10 years, and the only time I had to use pointers was during some interop work I was doing. Oh and a another time after I'd just graduated using c++ and didn't know how C# really worked, which was a bit embarrasing Smile | :)

Finally, please tag up your code with <pre> , it makes it easier to read. Otherwise you'll get responses of varying degrees of snottiness.

[edit]: When I said unmanaged code, I of course meant unsafe code. Better have a nice nap and a cup of tea, I'm getting old!
Sort of a cross between Lawrence of Arabia and Dilbert.[^]
modified on Saturday, October 9, 2010 1:03 PM

GeneralRe: Assign By Reference Pin
thenutz729-Oct-10 8:45
thenutz729-Oct-10 8:45 
GeneralRe: Assign By Reference Pin
PIEBALDconsult9-Oct-10 9:07
mvePIEBALDconsult9-Oct-10 9:07 
GeneralRe: Assign By Reference Pin
Keith Barrow9-Oct-10 9:33
professionalKeith Barrow9-Oct-10 9:33 
AnswerRe: Assign By Reference Pin
Eddy Vluggen9-Oct-10 6:55
professionalEddy Vluggen9-Oct-10 6:55 
AnswerRe: Assign By Reference Pin
Bernhard Hiller10-Oct-10 23:14
Bernhard Hiller10-Oct-10 23:14 
Questionencrypt App.config Pin
Jassim Rahma9-Oct-10 2:55
Jassim Rahma9-Oct-10 2:55 
AnswerRe: encrypt App.config Pin
Abhinav S9-Oct-10 3:07
Abhinav S9-Oct-10 3:07 
AnswerRe: encrypt App.config Pin
PIEBALDconsult9-Oct-10 3:41
mvePIEBALDconsult9-Oct-10 3:41 
GeneralRe: encrypt App.config Pin
Jassim Rahma9-Oct-10 4:04
Jassim Rahma9-Oct-10 4:04 
GeneralRe: encrypt App.config Pin
PIEBALDconsult9-Oct-10 6:07
mvePIEBALDconsult9-Oct-10 6:07 
Questioncompile App.config in the EXE or as DLL Pin
Jassim Rahma9-Oct-10 2:52
Jassim Rahma9-Oct-10 2:52 
QuestionWant to move a object in a window Pin
ranjan kumar saha8-Oct-10 10:43
ranjan kumar saha8-Oct-10 10:43 
AnswerRe: Want to move a object in a window Pin
Luc Pattyn8-Oct-10 16:50
sitebuilderLuc Pattyn8-Oct-10 16:50 
AnswerRe: Want to move a object in a window Pin
ekba8910-Oct-10 5:52
ekba8910-Oct-10 5:52 
QuestionRE: Save user's re-order grid preferences Pin
roman_s8-Oct-10 7:32
roman_s8-Oct-10 7:32 
AnswerRe: RE: Save user's re-order grid preferences Pin
Searril8-Oct-10 8:03
Searril8-Oct-10 8:03 
GeneralRe: RE: Save user's re-order grid preferences Pin
Richard Andrew x648-Oct-10 12:13
professionalRichard Andrew x648-Oct-10 12:13 

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.