Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataGrid Sorting Pin
jazzle14-Mar-04 9:52
jazzle14-Mar-04 9:52 
GeneralRe: DataGrid Sorting Pin
Mazdak14-Mar-04 9:57
Mazdak14-Mar-04 9:57 
GeneralRe: DataGrid Sorting Pin
jazzle14-Mar-04 10:07
jazzle14-Mar-04 10:07 
Generalhelp me Pin
vatavua13-Mar-04 3:21
vatavua13-Mar-04 3:21 
GeneralRe: help me Pin
Dave Kreskowiak13-Mar-04 4:26
mveDave Kreskowiak13-Mar-04 4:26 
GeneralRe: help me Pin
Corinna John13-Mar-04 8:18
Corinna John13-Mar-04 8:18 
GeneralRender child controls into memory dc Pin
Mathew Hall13-Mar-04 2:18
Mathew Hall13-Mar-04 2:18 
GeneralBit to Byte and base type size in C# Pin
Tristan Rhodes13-Mar-04 1:25
Tristan Rhodes13-Mar-04 1:25 
I'm trying to figure out the size of base types in bytes so that i can use the FieldOffset attribute properly. However, i'm seeing contradictory information.

If a byte is 8 bits, then a 64 bit integer (ulong) would take up 8 bytes in memory. So, i would assume that:

[FieldOffset(0)]<br />
ulong value1;<br />
[FieldOffset(8)]<br />
ulong value2;


would be the correct way of declaring this, however, in the FieldOffset documentation, they are declared as follows:

[StructLayout(LayoutKind.Explicit)]<br />
public class SYSTEM_INFO<br />
{<br />
[FieldOffset(0)] public ulong OemId;<br />
[FieldOffset(4)] public ulong PageSize;<br />
[FieldOffset(16)] public ulong ActiveProcessorMask;<br />
[FieldOffset(20)] public ulong NumberOfProcessors;<br />
[FieldOffset(24)] public ulong ProcessorType;<br />
}


these long values are using 4 bytes, which is a 32 bit memory block. Won't they over lap and cause the program to overlap, or behave weird?

Cheers

Cata
GeneralRe: Bit to Byte and base type size in C# Pin
leppie13-Mar-04 3:06
leppie13-Mar-04 3:06 
GeneralRe: Bit to Byte and base type size in C# Pin
Tristan Rhodes13-Mar-04 4:08
Tristan Rhodes13-Mar-04 4:08 
GeneralRe: Bit to Byte and base type size in C# Pin
leppie13-Mar-04 6:50
leppie13-Mar-04 6:50 
GeneralRe: Bit to Byte and base type size in C# Pin
Tristan Rhodes14-Mar-04 0:17
Tristan Rhodes14-Mar-04 0:17 
GeneralRe: Bit to Byte and base type size in C# Pin
leppie14-Mar-04 5:26
leppie14-Mar-04 5:26 
GeneralRe: Bit to Byte and base type size in C# Pin
Tristan Rhodes14-Mar-04 9:55
Tristan Rhodes14-Mar-04 9:55 
GeneralRe: Bit to Byte and base type size in C# Pin
leppie14-Mar-04 11:22
leppie14-Mar-04 11:22 
GeneralI need help with drag and drop Pin
cristiansje12-Mar-04 22:09
cristiansje12-Mar-04 22:09 
GeneralRe: I need help with drag and drop Pin
John Fisher13-Mar-04 4:17
John Fisher13-Mar-04 4:17 
GeneralRe: I need help with drag and drop Pin
cristiansje14-Mar-04 21:34
cristiansje14-Mar-04 21:34 
Generalapi documentation Pin
tonaxxlss12-Mar-04 18:52
susstonaxxlss12-Mar-04 18:52 
GeneralRe: api documentation Pin
Dave Kreskowiak13-Mar-04 2:37
mveDave Kreskowiak13-Mar-04 2:37 
GeneralRe: api documentation Pin
Nick Parker13-Mar-04 10:51
protectorNick Parker13-Mar-04 10:51 
GeneralRe: api documentation Pin
Prakash Nadar14-Mar-04 1:12
Prakash Nadar14-Mar-04 1:12 
Questionhow to change datalist's bind fied by codebehind code? Pin
BigGirlBigEyes12-Mar-04 17:04
BigGirlBigEyes12-Mar-04 17:04 
GeneralDataGrid to DataSet to XML Pin
jazzle12-Mar-04 16:04
jazzle12-Mar-04 16:04 
GeneralRe: DataGrid to DataSet to XML Pin
Mike Ellison12-Mar-04 19:07
Mike Ellison12-Mar-04 19:07 

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.