TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Puneet Gupta
932
546
53.8k
C++ to C# (checksum)
Oct 11 2013 6:44 AM
Can anyone convert this C++ code to C#
#include <stdio.h>
unsigned char calc_checksum(const char *s)
{
unsigned char result;
result = 0;
s++; // Skip dollar sign
while ((*s != '*') && (*s != '\0'))
result ^= *s++;
return result;
}
int main()
{
unsigned char checksum;
checksum = calc_checksum
("$GPRMC,235947.000,V,0000.0000,N,00000.0000,E,,,041299,,*");
printf("Checksum = %02X\n", checksum);
return 0;
}
I want same output in C# as i am getting in this c++ code. Please reply soon, Its very urgent.
Reply
Answers (
3
)
e.KeyCode property
error caused by text containing hyphen