Jump to content
  • Advertisement
Sign in to follow this  
Mania-92

Convert const char* to char[32]

This topic is 4068 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!