First problem:You should dynamically allocate memory for array of characters (not needed for a single character like "char a;").so you can use this code (As C@uark mentioned in previous quote):
Code:
char[] frameid = new char[4];
Second problem:in C# 2008 (not sure about other versions),we don't have keyword "unsigned".Instead,we use the character 'u' before the unsigned types.For example:
This piece of code declares x as a variable of type unsigned int.In other words,'u' is a shorthand for "unsigned".
And about char we don't have unsigned char,because char's definition is:
Single Unicode character, stored as an integer between 0 and 65535.
This is a definition from book "Beginning Microsoft Visual C# 2008".
As you see,char is automatically unsigned!!
You should enter this code instead of whole:
Code:
struct id3v2frameheader
{
char[] frameid = new char[4];
ulong size;//ulong is used instead of unsigned long
char flag1;
char flag2;
};
Erfan