Re: Converting Datatypes



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

.