D
Doug C via .NET 247
Using C#...
I am pulling shared memory in to my app that is in the form of apredefined structure. I have arrays in 2 sub-structures. Onearray is an array of another predefined structure, and the otheris simply an array of ushort's.
Such as:
public struct predefinedStruct {
public ushort a;
public ushort b;
}
public struct struct1 {
public int blah1;
public int blah2;
public predefinedStruct [] ARRAY1; // <-- size = 6
}
public struct struct2 {
public ushort blah1;
public ushort blah2;
public ushort [] ARRAY2; // <-- size = 32
}
...
for my pointer to this structure in memory to match thispredefined structure in my code, I need the size of my structurein my code to match the size of the structure in memory. Sotherefore I need to initialize my arrays. But I can't seem toinit them in the struct.
How can I initialize my two arrays, ARRAY1, and ARRAY2, in thiscase? The size of each array is:
ARRAY1 = 6 elements
ARRAY2 = 32 elements
I am pulling shared memory in to my app that is in the form of apredefined structure. I have arrays in 2 sub-structures. Onearray is an array of another predefined structure, and the otheris simply an array of ushort's.
Such as:
public struct predefinedStruct {
public ushort a;
public ushort b;
}
public struct struct1 {
public int blah1;
public int blah2;
public predefinedStruct [] ARRAY1; // <-- size = 6
}
public struct struct2 {
public ushort blah1;
public ushort blah2;
public ushort [] ARRAY2; // <-- size = 32
}
...
for my pointer to this structure in memory to match thispredefined structure in my code, I need the size of my structurein my code to match the size of the structure in memory. Sotherefore I need to initialize my arrays. But I can't seem toinit them in the struct.
How can I initialize my two arrays, ARRAY1, and ARRAY2, in thiscase? The size of each array is:
ARRAY1 = 6 elements
ARRAY2 = 32 elements