I\'m working in a C++ unmanaged project.
I need to know how can I take a string like this \"some data to encrypt\" and get a byte[] array which I\'m gonna use as the
If this is just plain vanilla C, then:
strcpy(buffer, text.c_str());
Assuming that buffer is allocated and large enough to hold the contents of 'text', which is the assumption in your original code.
If encrypt() takes a 'const char *' then you can use
encrypt(text.c_str())
and you do not need to copy the string.