Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: Interops and Strong Names Pin
je_gonzalez25-Sep-03 8:53
je_gonzalez25-Sep-03 8:53 
QuestionHow to execute UNIX commands in C# Pin
Buckin25-Sep-03 6:33
Buckin25-Sep-03 6:33 
AnswerRe: How to execute UNIX commands in C# Pin
Anonymous25-Sep-03 17:41
Anonymous25-Sep-03 17:41 
GeneralRe: How to execute UNIX commands in C# Pin
Buckin25-Sep-03 17:56
Buckin25-Sep-03 17:56 
GeneralWindows Form DataGrid OnClick Pin
devvvy25-Sep-03 6:07
devvvy25-Sep-03 6:07 
GeneralRe: Windows Form DataGrid onclick Pin
ankita patel25-Sep-03 8:29
ankita patel25-Sep-03 8:29 
GeneralInserting Excel page breaks Pin
Anonymous25-Sep-03 5:53
Anonymous25-Sep-03 5:53 
GeneralC# structures Pin
Simon Wren25-Sep-03 5:32
professionalSimon Wren25-Sep-03 5:32 
Hi all, hope you can help on this one.

I have a C++ struct like this below:

struct OTHERSTRUCT Thing[MAX_NO] = {
{1, "x"},
{2, "xx"},
};

where OTHERSTRUCT is:

struct OTHERSTRUCT
{
int Num;
CString Desc;
};

My question is how do i replicate this in C#? the only way i have so far got this to work is shown below:

public struct tagLINE
{
public tagLINE(int ACode, string ADesc)
{
Code = ACode;
Desc = ADesc;
}

int Code;
string Desc;
};

And creating an instance of it like this:

public tagLINE[] A = new tagLINE[3] {new tagLINE(0, "0"),
new tagLINE(1, "1"),
new tagLINE(2, "2")};

Do i really have do all this "new"ing? Any feedback would be
great. Smile | :)

Simon Wren
simon.wren@nesltd.co.uk
C++ Application Team Leader
National Energy Services Ltd
Visit Us: www.nesltd.co.uk Or: www.nher.co.uk
GeneralRe: C# structures Pin
leppie25-Sep-03 7:11
leppie25-Sep-03 7:11 
GeneralRe: C# structures Pin
Alvaro Mendez25-Sep-03 10:50
Alvaro Mendez25-Sep-03 10:50 
GeneralRe: C# structures Pin
Anonymous25-Sep-03 17:45
Anonymous25-Sep-03 17:45 
GeneralGroup Policies Pin
Alex Korchemniy25-Sep-03 4:48
Alex Korchemniy25-Sep-03 4:48 
GeneralSerializing an object which contains other objects.. Pin
morefire25-Sep-03 0:14
morefire25-Sep-03 0:14 
GeneralRe: Serializing an object which contains other objects.. Pin
Stephane David25-Sep-03 1:52
Stephane David25-Sep-03 1:52 
GeneralRe: Serializing an object which contains other objects.. Pin
James Simpson25-Sep-03 2:06
James Simpson25-Sep-03 2:06 
GeneralRe: Serializing an object which contains other objects.. Pin
morefire25-Sep-03 2:40
morefire25-Sep-03 2:40 
Questionxp style menu with merge option? Pin
Tomaž Štih24-Sep-03 23:37
Tomaž Štih24-Sep-03 23:37 
GeneralDrag & Drop Pin
Mazdak24-Sep-03 21:29
Mazdak24-Sep-03 21:29 
GeneralRe: Drag & Drop Pin
J. Dunlap24-Sep-03 22:00
J. Dunlap24-Sep-03 22:00 
GeneralRe: Drag & Drop Pin
Mazdak24-Sep-03 23:52
Mazdak24-Sep-03 23:52 
GeneralRe: Drag & Drop Pin
J. Dunlap25-Sep-03 11:09
J. Dunlap25-Sep-03 11:09 
GeneralRe: Drag & Drop Pin
Mazdak25-Sep-03 20:31
Mazdak25-Sep-03 20:31 
GeneralVersionning and serialization Pin
Stephane David24-Sep-03 21:23
Stephane David24-Sep-03 21:23 
QuestionHow to create TCP Listener windows service usingC# Pin
Baqer24-Sep-03 19:53
Baqer24-Sep-03 19:53 
AnswerRe: How to create TCP Listener windows service usingC# Pin
James Simpson25-Sep-03 3:48
James Simpson25-Sep-03 3:48 

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.