Convert 6 lines of C++ to C# or vb.net

This is a discussion on Convert 6 lines of C++ to C# or vb.net within the C++ Programming forums, part of the General Programming Boards category; Dear All , I am a C#.net , vb .net user . I have a problem with a code that ...

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    1

    Convert 6 lines of C++ to C# or vb.net

    Dear All ,

    I am a C#.net , vb.net user . I have a problem with a code that has only 6 lines in C++ that I want to translate to vb.net or C# . Here is the code :


    Code:
    GUCHAR GenerateCkSum(GUCHAR *pure_data, U2 size)
    {
    GUCHAR chksum;
    I2 i;
    chksum = pure_data[0];
    for(i=1; i<size ; i++)
    chksum ^= pure_data[i];
    return chksum;
    }
    the code calcualtes the checksum of a string . it makes for the following string "PTSI000,TSI" >>> gives a checksum of 4C. How can i make the code in C#.net or vb.net .


    Thank you all for your support ,

    WSN

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,453
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with deleting completely blank lines
    By dnguyen1022 in forum C Programming
    Replies: 3
    Last Post: 12-07-2008, 10:51 AM
  2. Circular linked list to print last N lines of file
    By FortinsM3 in forum C Programming
    Replies: 7
    Last Post: 10-24-2008, 05:42 PM
  3. Replies: 11
    Last Post: 10-07-2008, 06:19 PM
  4. Simple answer for intersecting lines?
    By LLINE in forum C++ Programming
    Replies: 6
    Last Post: 06-01-2008, 02:10 AM
  5. recv multiple lines
    By TCM in forum Networking/Device Communication
    Replies: 11
    Last Post: 07-13-2004, 04:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21