packet.Data(i) = (Byte)'#'
???
i know what packet.Data(i) is ...but the (byte)'#'??
cant find anything on what that is....
Printable View
packet.Data(i) = (Byte)'#'
???
i know what packet.Data(i) is ...but the (byte)'#'??
cant find anything on what that is....
(byte) is a casting, i guess they call it boxing and unboxing in .netQuote:
Originally posted by Cander
packet.Data(i) = (Byte)'#'
???
i know what packet.Data(i) is ...but the (byte)'#'??
cant find anything on what that is....
in vb its done for you
for example
string number = "2344"
single number2 = number;
this is valid in vb
how ever in c# it has to be something like
string number ="2344";
int number2 = Convert.toInt32(number); OR int number2 = (Integer)number;
its converting the "#" to a byte datatype
Ok I think I understand.
VB.Net doesn't allow implic conversion like this, unless Option Strict OFF is set.
Here is a VB example of the above code. It's called Literal Type Identifiers
Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As Object
x = 100I
MsgBox(x.GetType.ToString)
End Sub