Click here to Skip to main content
15,921,452 members
Home / Discussions / C#
   

C#

 
Questionclass or struct Pin
Harvey Saayman26-Nov-08 2:46
Harvey Saayman26-Nov-08 2:46 
AnswerRe: class or struct Pin
Thomas Weller26-Nov-08 3:06
Thomas Weller26-Nov-08 3:06 
AnswerRe: class or struct Pin
Jan Sommer26-Nov-08 3:09
Jan Sommer26-Nov-08 3:09 
GeneralRe: class or struct Pin
Thomas Weller26-Nov-08 4:15
Thomas Weller26-Nov-08 4:15 
GeneralRe: class or struct Pin
Jan Sommer26-Nov-08 4:31
Jan Sommer26-Nov-08 4:31 
GeneralRe: class or struct Pin
Thomas Weller26-Nov-08 4:53
Thomas Weller26-Nov-08 4:53 
AnswerRe: class or struct Pin
Alan Balkany26-Nov-08 3:44
Alan Balkany26-Nov-08 3:44 
GeneralRe: class or struct Pin
Guffa26-Nov-08 4:14
Guffa26-Nov-08 4:14 
Alan Balkany wrote:
As was pointed out earlier, a struct is less efficient to pass as a parameter because the whole object is pushed onto the stack. A class only has its reference (an address) put on the stack, so is faster to pass.


If the struct is small enough, it can be copied with a single instruction, making it just as efficient as copying a reference. It's recommended that a struct should not be larger than 16 bytes, so that it can be copied with a few instructions, without using a loop.

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

AnswerRe: class or struct Pin
Guffa26-Nov-08 3:51
Guffa26-Nov-08 3:51 
AnswerRe: class or struct Pin
PIEBALDconsult26-Nov-08 7:35
mvePIEBALDconsult26-Nov-08 7:35 
GeneralMoving Data Pin
Dwood26-Nov-08 2:31
Dwood26-Nov-08 2:31 
GeneralRe: Moving Data Pin
Ben Fair26-Nov-08 3:21
Ben Fair26-Nov-08 3:21 
Questionstore image into memory Pin
George_George26-Nov-08 2:22
George_George26-Nov-08 2:22 
AnswerRe: store image into memory Pin
Giorgi Dalakishvili26-Nov-08 2:27
mentorGiorgi Dalakishvili26-Nov-08 2:27 
GeneralRe: store image into memory Pin
George_George26-Nov-08 2:34
George_George26-Nov-08 2:34 
GeneralRe: store image into memory Pin
Giorgi Dalakishvili26-Nov-08 2:42
mentorGiorgi Dalakishvili26-Nov-08 2:42 
GeneralRe: store image into memory Pin
George_George26-Nov-08 3:20
George_George26-Nov-08 3:20 
GeneralRe: store image into memory Pin
J4amieC26-Nov-08 2:43
J4amieC26-Nov-08 2:43 
GeneralRe: store image into memory Pin
George_George26-Nov-08 3:29
George_George26-Nov-08 3:29 
GeneralRe: store image into memory Pin
Alan Balkany26-Nov-08 3:48
Alan Balkany26-Nov-08 3:48 
GeneralRe: store image into memory Pin
George_George26-Nov-08 4:36
George_George26-Nov-08 4:36 
GeneralRe: store image into memory Pin
Alan Balkany26-Nov-08 5:20
Alan Balkany26-Nov-08 5:20 
GeneralRe: store image into memory Pin
George_George26-Nov-08 18:25
George_George26-Nov-08 18:25 
GeneralRe: store image into memory Pin
Alan Balkany26-Nov-08 21:10
Alan Balkany26-Nov-08 21:10 
GeneralRe: store image into memory Pin
George_George26-Nov-08 21:13
George_George26-Nov-08 21: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.