Convert const char* to char[32]

Started by
1 comment, last by Mania-92 16 years, 11 months ago
How do I convert a const char* to char[32]? I've this code:
MD5Check = md5.getMD5Digest();
And here MD5Check is a char[32] and md5.getMD5Digest() is a const char*, now this gives a error (ofcourse) because I need to convert md5.getMD5Digest() to a char[32]. But when I do something like this:
MD5Check = (char[32])md5.getMD5Digest();
It also gives a error, so my question is how to do this correctly?
Advertisement
You can't.

You can either change MD5Check to be a const char *
or memcpy the returned buffer to your buffer.

Hope this helps.
Yes, thanks it works. :D

This topic is closed to new replies.

Advertisement