Click here to Skip to main content
15,905,028 members
Home / Discussions / C#
   

C#

 
GeneralRe: Array of Struct within Struct Pin
Heath Stewart13-Jul-04 9:21
protectorHeath Stewart13-Jul-04 9:21 
GeneralRe: Array of Struct within Struct Pin
Uday Shastri13-Jul-04 9:47
Uday Shastri13-Jul-04 9:47 
GeneralRe: Array of Struct within Struct Pin
Heath Stewart13-Jul-04 10:19
protectorHeath Stewart13-Jul-04 10:19 
Generalupload files Pin
Steven M Hunt13-Jul-04 7:03
Steven M Hunt13-Jul-04 7:03 
GeneralRe: upload files Pin
Heath Stewart13-Jul-04 9:17
protectorHeath Stewart13-Jul-04 9:17 
GeneralRe: upload files Pin
Steven M Hunt14-Jul-04 14:31
Steven M Hunt14-Jul-04 14:31 
GeneralRe: upload files Pin
Heath Stewart19-Jul-04 2:02
protectorHeath Stewart19-Jul-04 2:02 
Generalstruct question Pin
ConfusedAsHeck13-Jul-04 5:30
sussConfusedAsHeck13-Jul-04 5:30 
hi I have a VC++ program which has a struct defined. I am trying to declare the same struct in c# and am having some problem

--In VC++ , lets say my struct looked like
#define MAX_UNITS 100

struct _MyStruct{
int X;
int Y;
char Units[MAX_UNITS];
};

I can do a sizeof(_MyStruct) and it return me the size including the 100 char array in the struct

--In C#, i tried to declare the following
// all in an unsafe class
struct _MyStruct{
int X;
int Y;
char [] Units = new char[MAX_UNITS];
};
//gives me compile time error about initialising in the struct

so I tried;
struct _MyStruct{
int X;
int Y;
char [] Units;
};

but now i cant use sizeof, and if i use the marshal.sizeof, it returns 12. I need the size with the 100 char array. Any suggestions

thanks

GeneralRe: struct question Pin
Tom Larsen13-Jul-04 5:34
Tom Larsen13-Jul-04 5:34 
GeneralRe: struct question Pin
Heath Stewart13-Jul-04 6:11
protectorHeath Stewart13-Jul-04 6:11 
GeneralAccessing Forms Pin
Mehbub13-Jul-04 5:02
Mehbub13-Jul-04 5:02 
GeneralRe: Accessing Forms Pin
Tom Larsen13-Jul-04 5:27
Tom Larsen13-Jul-04 5:27 
GeneralRe: Accessing Forms Pin
Colin Angus Mackay13-Jul-04 6:03
Colin Angus Mackay13-Jul-04 6:03 
GeneralRe: Accessing Forms Pin
Dave Kreskowiak13-Jul-04 12:46
mveDave Kreskowiak13-Jul-04 12:46 
GeneralRe: Accessing Forms Pin
Weiye Chen13-Jul-04 19:36
Weiye Chen13-Jul-04 19:36 
GeneralRe: Accessing Forms Pin
Weiye Chen13-Jul-04 20:52
Weiye Chen13-Jul-04 20:52 
GeneralViewing Exported Functions and Parameters in a DLL Pin
Mr. Rogers13-Jul-04 4:22
Mr. Rogers13-Jul-04 4:22 
GeneralRe: Viewing Exported Functions and Parameters in a DLL Pin
Heath Stewart13-Jul-04 4:33
protectorHeath Stewart13-Jul-04 4:33 
GeneralRe: Viewing Exported Functions and Parameters in a DLL Pin
Mr. Rogers13-Jul-04 4:51
Mr. Rogers13-Jul-04 4:51 
QuestionHow to get the time from a computer Pin
Stuggo13-Jul-04 4:11
Stuggo13-Jul-04 4:11 
AnswerRe: How to get the time from a computer Pin
Heath Stewart13-Jul-04 4:20
protectorHeath Stewart13-Jul-04 4:20 
GeneralResponse.Redirect is not working.. a peculiar problem..One solution found !! Pin
PhaniKatakam13-Jul-04 2:07
PhaniKatakam13-Jul-04 2:07 
GeneralRe: Response.Redirect is not working.. a peculiar problem..One solution found !! Pin
Heath Stewart13-Jul-04 4:13
protectorHeath Stewart13-Jul-04 4:13 
GeneralAccessing HTML control Pin
Padmavathi13-Jul-04 1:26
Padmavathi13-Jul-04 1:26 
GeneralRe: Accessing HTML control Pin
Heath Stewart13-Jul-04 4:07
protectorHeath Stewart13-Jul-04 4: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.