C
Ciaran
Hi there,
I'm not very good at c and I was wondering if anyone could give
me a hand converting the following code snippet to c# ...
BYTE checksum(BYTE *InStr, BYTE len)
{
BYTE i, sum = 0;
for (i = 0; i < len; ++i) {
sum += InStr;
if (sum & 0x80) {
sum &= 0x7F;
++sum;
}
}
sum = ~sum;
sum &= 0x7F;
if (sum == 0)
sum = 0x7F;
return (sum);
}
Thanks a million !!!
I'm not very good at c and I was wondering if anyone could give
me a hand converting the following code snippet to c# ...
BYTE checksum(BYTE *InStr, BYTE len)
{
BYTE i, sum = 0;
for (i = 0; i < len; ++i) {
sum += InStr;
if (sum & 0x80) {
sum &= 0x7F;
++sum;
}
}
sum = ~sum;
sum &= 0x7F;
if (sum == 0)
sum = 0x7F;
return (sum);
}
Thanks a million !!!