I'm trying to do this:
public static class GlobalVar
{
[DllImport("Export.dll")]
public static extern sentences Export();
public unsafe struct sentence_node
{
public sentence_node* next; // next node in the dictionary in the same level
public int sNum; // sentence number starting from 1
public int sLoc; // the location in the sentence (protien)
}
public unsafe struct sentences
{ // list of lists of sentences in which words exists.
public fixed sentence_node* sList[50];
public char[,] xplus = new char[50, 100];
public int wordCount;
}
}
but I get these two errors :
Error 1:
Fixed size buffer type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double C:\Users\Aseel\Documents\Visual Studio 2010\Projects\CBS\CBS\GlobalVar.cs 40 22 CBS
Error 2:
GlobalVar.sentences.xplus': cannot have instance field initializers in structs C:\Users\Aseel\Documents\Visual Studio 2010\Projects\CBS\CBS\GlobalVar.cs 41 24 CBS
The dll file contains the search algorithm in C language and have the two struct I posted above plus other struct, but I need those two to display my result. Is there a way to get into these struct without redefining them again in C#?
class
. (msdn.microsoft.com/en-us/library/y23b5415%28VS.71%29.aspx) – pascalhein