|
-
February 10th, 2009, 01:51 AM
#1
Declaring pointers
How can we declare and address pointer of this structure
public struct PASSTHRU_MSG
{
unsafe public System.Int32 ProtocolID;
unsafe public System.Int32 RxStatus;
unsafe public System.Int32 TxFlags;
unsafe public System.Int32 Timestamp;
unsafe public System.Int32 DataSize;
unsafe public System.Int32 ExtraDataIndex;
unsafe public System.Byte[] Data;
}
where Data is fixed array of 4000 bytes
When I try
unsafe
{
PASSTHRU_MSG1* test;
test = &ptrMsg;
}
It gives error
Error 1 Cannot take the address of, get the size of, or declare a pointer to a managed type ('project.Form1.PASSTHRU_MSG1')
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|