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

C#

 
GeneralRe: capture command line output Pin
IsaacB3-Oct-03 4:06
IsaacB3-Oct-03 4:06 
GeneralCOM interop and data types Pin
lpvoid1-Oct-03 10:07
lpvoid1-Oct-03 10:07 
GeneralRe: COM interop and data types Pin
Corinna John1-Oct-03 23:48
Corinna John1-Oct-03 23:48 
GeneralSelf Upgrading Executables (C# Windows App) Pin
OBRon1-Oct-03 9:45
OBRon1-Oct-03 9:45 
GeneralRe: Self Upgrading Executables (C# Windows App) Pin
SimonS2-Oct-03 1:24
SimonS2-Oct-03 1:24 
GeneralRe: Self Upgrading Executables (C# Windows App) Pin
OBRon2-Oct-03 2:54
OBRon2-Oct-03 2:54 
QuestionCOM Ports in C# - How ? Pin
raheela1-Oct-03 9:42
raheela1-Oct-03 9:42 
GeneralArray question Pin
Joe Woodbury1-Oct-03 7:56
professionalJoe Woodbury1-Oct-03 7:56 
Is there any equivilent in C# of the following C++ construct:
struct Data
{
   int val;
   char* pStr;
};

Data data[] = 
{
   { 0, "Zero" },
   { 1, "One" },
   { -1, NULL }
};

I tried the following, and a few variations, but they didn't work:
public struct Data
{
   public int val;
   public string str;
};

static public Data data[] = 
{
   { 0, "Zero" },
   { 1, "One" },
   { -1, NULL }
};

The following works, but it really bugs me:
public struct Data
{
   public int val;
   public string str;
   public Data(int v, string s) { val = v; str = s; }
};

static public Data data[] = 
{
   new Data(0, "Zero"),
   new Data(1, "One" ),
   new Data(-1, NULL )
};

Am I missing something?
Joe Woodbury

When all else fails, there's always delusion.
- Conan O'Brien
GeneralRe: Array question Pin
jparsons1-Oct-03 9:20
jparsons1-Oct-03 9:20 
GeneralRe: Array question Pin
Joe Woodbury1-Oct-03 10:59
professionalJoe Woodbury1-Oct-03 10:59 
GeneralRe: Array question Pin
Frank Olorin Rizzi2-Oct-03 4:12
Frank Olorin Rizzi2-Oct-03 4:12 
GeneralRe: Array question Pin
jparsons2-Oct-03 5:29
jparsons2-Oct-03 5:29 
GeneralRe: Array question Pin
Julian Bucknall [MSFT]2-Oct-03 6:13
Julian Bucknall [MSFT]2-Oct-03 6:13 
GeneralRe: Array question Pin
Joe Woodbury2-Oct-03 6:40
professionalJoe Woodbury2-Oct-03 6:40 
GeneralInspiration needed - end user form editing Pin
Member 961-Oct-03 6:59
Member 961-Oct-03 6:59 
GeneralRe: Inspiration needed - end user form editing Pin
Michael P Butler2-Oct-03 1:42
Michael P Butler2-Oct-03 1:42 
GeneralRe: Inspiration needed - end user form editing Pin
Member 962-Oct-03 5:05
Member 962-Oct-03 5:05 
Generalremoting event problem Pin
manusha1-Oct-03 5:37
manusha1-Oct-03 5:37 
Generalimporting VB 6.0 into C# project... Pin
Anonymous1-Oct-03 4:47
Anonymous1-Oct-03 4:47 
GeneralGDI+ font and scalable graphics Pin
Member 5506441-Oct-03 2:33
Member 5506441-Oct-03 2:33 
GeneralRe: GDI+ font and scalable graphics Pin
Mazdak1-Oct-03 3:46
Mazdak1-Oct-03 3:46 
GeneralRe: GDI+ font and scalable graphics Pin
Member 5506441-Oct-03 4:03
Member 5506441-Oct-03 4:03 
GeneralRe: GDI+ font and scalable graphics Pin
azusakt1-Oct-03 15:21
azusakt1-Oct-03 15:21 
Generalthreading issue... Pin
profoundwhispers1-Oct-03 0:53
profoundwhispers1-Oct-03 0:53 
GeneralRe: threading issue... Pin
Blake Coverett1-Oct-03 1:50
Blake Coverett1-Oct-03 1:50 

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.