Valhalla Legends Archive

Programming => General Programming => .NET Platform => Topic started by: mentalCo. on November 02, 2004, 07:46 PM

Title: [vb.net] noob question
Post by: mentalCo. on November 02, 2004, 07:46 PM
how do you assign a value to a short from a buffer.  like in c++ its:

shortSomevalue = *(unsigned short*)(buffer+2)
Title: Re: [vb.net] noob question
Post by: MyndFyre on November 02, 2004, 07:53 PM
Use the BitConverter class.  I remark about it briefly in this post (http://forum.valhallalegends.com/phpbbs/index.php?topic=6860.0) (in other words, you could have searched).

Information on the BitConverter class can be found at MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystembitconverterclasstopic.asp).