Re: Converting Datatypes
- From: Ian Semmel <isemmelNOJUNK@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 15 Sep 2006 03:53:04 +1000
C# does not have pointers. You are putting the value of data[0] into i_data.
You will have to rethink whatever you are doing.
AMP wrote:
Hello,.
I have in c:
WORD calcChecksum(BYTE data[], WORD length)
{
WORD* i_data;
WORD checksum= 0;
BYTE i= 0;
i_data= (WORD*)data;
data.. which is data[0] comes in at 128 and gets changed to 6272 by the
statement above.
in c# i did this
ushort i_data;
ushort checksum = 0;
byte i = 0;
i_data = (ushort)data[0];
but i_data dos not change here.
Help!
And Thanks
- Follow-Ups:
- Re: Converting Datatypes
- From: Kevin Spencer
- Re: Converting Datatypes
- From: AMP
- Re: Converting Datatypes
- References:
- Converting Datatypes
- From: AMP
- Converting Datatypes
- Prev by Date: Re: statics & memory
- Next by Date: Re: Windows service - Nightly task
- Previous by thread: Converting Datatypes
- Next by thread: Re: Converting Datatypes
- Index(es):