string to byte array

M

Magix

Hi,

I would like to convert a string to byte array.
I'm using Win32 Visual C++.

Thanks.
 
R

Rolf Magnus

Tim said:
Not quite sure what you want, so I'll point out that C++ strings have
a c_str() member function.

And a data() function, in case a terminating \0 is not needed.
 
M

Magix

Rolf Magnus said:
And a data() function, in case a terminating \0 is not needed.

it's something like:

byte ConvertStringtoByteArray(CString s) []
{
//add code here
// return byte array pointer
}
 
J

Jack Klein

Rolf Magnus said:
And a data() function, in case a terminating \0 is not needed.

it's something like:

byte ConvertStringtoByteArray(CString s) []
{
//add code here
// return byte array pointer
}

The C++ language does not have a CString. That's a Microsoft specific
non-standard extension, so you'll need to ask about it in a Microsoft
specific group. is quite
good.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,655
Latest member
eizareri

Latest Threads

Top