Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email email@example.com
Re: Question about Data type in VB.NET
From: Vade 79 (v9fakehalo.deadpig.org)
Date: Wed Oct 22 2003 - 15:03:10 CDT
>In VB.NET if we declare an int by default from what I understand it is a 32 bit int size ranges from -2,147,483,648 through 2,147,483,647. The size range for short however is -32,768 through 32,767 and char is 0 through 65535 (unsigned) (msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vagrpdatatype.asp).
correction; char is 1-256.
think of how these are stored in memory, int = 4 byte comparison(256*256*256*256=4294967296), short = two byte comparison(256*256=65536), char = 1 byte(256).
by default these casts are signed, making it half negative and half positive like you show, so if you don't want the negative aspect use something like: unsigned int = 4294967295(==-1,max).
basically, use an "unsigned short" for a port value..