Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unsafe statement in c#

Status
Not open for further replies.

stonee74

Technical User
Nov 12, 2001
49
0
0
CH
I receive the following message when I compile;

unsafe bool Initialize()
{

//You can only take the address of unfixed expression inside of a fixed statement initializer

CInit Data = new CInit();
return SendPacket(&Data.DataPacket,
System.Runtime.InteropServices.Marshal.SizeOf(Data.DataPacket));

}

Why is that?




Another thing:
Imagine I would like to send a similar created object via socket.send() method to a server, socket.send does only accept byte[], how to do that?

Thanks a lot,
stonee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top