Click here to Skip to main content
15,890,185 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error using an array of structs that contain an array Pin
Bruce Coward22-Feb-09 6:17
Bruce Coward22-Feb-09 6:17 
GeneralRe: Error using an array of structs that contain an array Pin
riced22-Feb-09 7:09
riced22-Feb-09 7:09 
GeneralRe: Error using an array of structs that contain an array Pin
Bruce Coward23-Feb-09 1:45
Bruce Coward23-Feb-09 1:45 
GeneralRe: Error using an array of structs that contain an array Pin
riced23-Feb-09 2:24
riced23-Feb-09 2:24 
GeneralRe: Error using an array of structs that contain an array Pin
riced22-Feb-09 8:04
riced22-Feb-09 8:04 
AnswerRe: Error using an array of structs that contain an array Pin
Luc Pattyn22-Feb-09 8:35
sitebuilderLuc Pattyn22-Feb-09 8:35 
GeneralRe: Error using an array of structs that contain an array Pin
Bruce Coward22-Feb-09 22:18
Bruce Coward22-Feb-09 22:18 
AnswerRe: Error using an array of structs that contain an array Pin
Luc Pattyn23-Feb-09 2:13
sitebuilderLuc Pattyn23-Feb-09 2:13 
Hi Bruce,

if your struct is used in managed code only, and does not have to exactly match either a file structure or some unmanaged struct (as in Win32 API), then I suggest:
- you remove all the unsafe and fixed stuff;
- you use a regular array in that struct;
- optionally you add a constructor to your struct, which creates the array with 8 elements.

So it would look along these lines:
struct aha {
    public int someInt;
    public int[] theArray;

    public aha() {
        theArray=new int[8];
    }
}


Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


modified on Sunday, June 12, 2011 8:30 AM

QuestionMSDE connection fails Pin
picasso222-Feb-09 5:24
picasso222-Feb-09 5:24 
AnswerRe: MSDE connection fails Pin
ABitSmart22-Feb-09 14:34
ABitSmart22-Feb-09 14:34 
QuestionListbox Pin
mrithula822-Feb-09 5:02
mrithula822-Feb-09 5:02 
AnswerRe: Listbox Pin
Xmen Real 22-Feb-09 7:00
professional Xmen Real 22-Feb-09 7:00 
GeneralRe: Listbox Pin
mrithula822-Feb-09 17:37
mrithula822-Feb-09 17:37 
QuestionExtending the TreeNode class Pin
Jastons22-Feb-09 3:38
Jastons22-Feb-09 3:38 
AnswerRe: Extending the TreeNode class Pin
ABitSmart22-Feb-09 4:02
ABitSmart22-Feb-09 4:02 
GeneralRe: Extending the TreeNode class Pin
Jastons22-Feb-09 5:32
Jastons22-Feb-09 5:32 
QuestionMap Wrapping Pin
Jim Warburton22-Feb-09 3:24
Jim Warburton22-Feb-09 3:24 
Questionbase64 and UTF-8 encoding issue Pin
George_George22-Feb-09 3:09
George_George22-Feb-09 3:09 
AnswerRe: base64 and UTF-8 encoding issue Pin
Xmen Real 22-Feb-09 3:12
professional Xmen Real 22-Feb-09 3:12 
GeneralRe: base64 and UTF-8 encoding issue Pin
George_George22-Feb-09 3:22
George_George22-Feb-09 3:22 
GeneralRe: base64 and UTF-8 encoding issue Pin
Xmen Real 22-Feb-09 3:27
professional Xmen Real 22-Feb-09 3:27 
GeneralRe: base64 and UTF-8 encoding issue Pin
George_George22-Feb-09 20:32
George_George22-Feb-09 20:32 
QuestionSolitaire like card game Pin
nubbs22-Feb-09 3:01
nubbs22-Feb-09 3:01 
AnswerRe: Solitaire like card game Pin
Xmen Real 22-Feb-09 3:11
professional Xmen Real 22-Feb-09 3:11 
QuestionSecond form using accessors of first form to alter first form object properties problem Pin
Member 210292422-Feb-09 2:54
Member 210292422-Feb-09 2:54 

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.