Results 1 to 4 of 4

Thread: What the freak does this mean

  1. #1

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    What the freak does this mean

    packet.Data(i) = (Byte)'#'


    ???

    i know what packet.Data(i) is ...but the (byte)'#'??

    cant find anything on what that is....
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Re: What the freak does this mean

    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....
    (byte) is a casting, i guess they call it boxing and unboxing in .net
    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

  3. #3

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Ok I think I understand.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width