Click here to Skip to main content
16,019,957 members
Home / Discussions / C#
   

C#

 
QuestionPrinting Problem . Pin
hdv2124-Aug-06 23:24
hdv2124-Aug-06 23:24 
QuestionReport generator ... Pin
mostafa_h4-Aug-06 22:51
mostafa_h4-Aug-06 22:51 
AnswerRe: Report generator ... Pin
WillemM5-Aug-06 23:42
WillemM5-Aug-06 23:42 
GeneralRe: Report generator ... Pin
mostafa_h6-Aug-06 7:49
mostafa_h6-Aug-06 7:49 
GeneralRe: Report generator ... Pin
WillemM6-Aug-06 7:57
WillemM6-Aug-06 7:57 
GeneralRe: Report generator ... Pin
mostafa_h6-Aug-06 9:34
mostafa_h6-Aug-06 9:34 
QuestionStruct Arrays Pin
Stephen_Mc4-Aug-06 21:57
Stephen_Mc4-Aug-06 21:57 
AnswerRe: Struct Arrays Pin
Guffa4-Aug-06 22:43
Guffa4-Aug-06 22:43 
Make a constructor in the struct.

I have given the member variables some more descriptive names, but as I couldn't figure your variable names out, I may be way off what you intended. Wink | ;)

I also made the member variables private and made read-only properties for them, so that the structure is immutable.

public struct Symbol {

   private char keyword;
   private int defibrilator;
   private bool passDefibrilator;
   private int index;

   public symbol( char keyword, int defibrilator, bool passDefibrilator, int index) {
      this.keyword = keyword;
      this.defibrilator = defibrilator;
      this.passDefibrilator = passDefibrilator;
      this.index = index;
   }

   public char Keyword { get { return this.keyword; } }
   public int Defibrilator { get { return this.defibrilator; } }
   public bool PassDefibrilator { get { return this.passDefibrilator; } }
   public int Index { get { return this.index; } }

}

As you have a constructor, you can easily create an array of structures:

Symbol[] symbols = new Symbol[] {
   new Symbol('a', 42, true, 1),
   new Symbol('b', 8, false, 5),
   new Symbol('c', 199866, false, 377378423),
};



---
b { font-weight: normal; }

GeneralRe: Struct Arrays Pin
Stephen_Mc6-Aug-06 14:17
Stephen_Mc6-Aug-06 14:17 
QuestionBarcode Application Pin
yousafzai4-Aug-06 21:40
yousafzai4-Aug-06 21:40 
AnswerRe: Barcode Application Pin
stancrm4-Aug-06 22:35
stancrm4-Aug-06 22:35 
Questionhow to add EventHandlers? Pin
yousafzai4-Aug-06 21:38
yousafzai4-Aug-06 21:38 
AnswerRe: how to add EventHandlers? Pin
Stefan Troschuetz4-Aug-06 21:52
Stefan Troschuetz4-Aug-06 21:52 
QuestionComponent with context menu on design mode ? Pin
Ariston Darmayuda4-Aug-06 20:54
Ariston Darmayuda4-Aug-06 20:54 
QuestionRichtext box Ctrl + I Pin
AB77714-Aug-06 20:22
AB77714-Aug-06 20:22 
AnswerRe: Richtext box Ctrl + I Pin
Dave Kreskowiak5-Aug-06 4:35
mveDave Kreskowiak5-Aug-06 4:35 
GeneralRe: Richtext box Ctrl + I Pin
AB77716-Aug-06 19:09
AB77716-Aug-06 19:09 
QuestionSecuring Software Pin
Stick^4-Aug-06 20:16
Stick^4-Aug-06 20:16 
AnswerRe: Securing Software Pin
Christian Graus4-Aug-06 22:58
protectorChristian Graus4-Aug-06 22:58 
GeneralRe: Securing Software Pin
Stick^4-Aug-06 23:35
Stick^4-Aug-06 23:35 
GeneralRe: Securing Software Pin
Christian Graus4-Aug-06 23:45
protectorChristian Graus4-Aug-06 23:45 
QuestionHow to host a socket server Pin
vik204-Aug-06 20:12
vik204-Aug-06 20:12 
Questionhow to convert float value to time? Pin
Nagraj Naik4-Aug-06 19:44
Nagraj Naik4-Aug-06 19:44 
AnswerRe: how to convert float value to time? Pin
Expert Coming4-Aug-06 21:09
Expert Coming4-Aug-06 21:09 
QuestionHow to assign a specific value to all the array elements at the time of initilization? Pin
signbit4-Aug-06 19:29
signbit4-Aug-06 19:29 

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.