By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,301 Members | 1,463 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,301 IT Pros & Developers. It's quick & easy.

string to byte array

P: n/a
Hi,

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

Thanks.
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Magix" <ma***@asia.com> writes:
Hi, I would like to convert a string to byte array.

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

Jul 23 '05 #2

P: n/a
Tim Love wrote:
"Magix" <ma***@asia.com> writes:
Hi,

I would like to convert a string to byte array.

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.

Jul 23 '05 #3

P: n/a

"Rolf Magnus" <ra******@t-online.de> wrote in message
news:cv*************@news.t-online.com...
Tim Love wrote:
"Magix" <ma***@asia.com> writes:
Hi,

I would like to convert a string to byte array.

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.


it's something like:

byte ConvertStringtoByteArray(CString s) []
{
//add code here
// return byte array pointer
}
Jul 23 '05 #4

P: n/a
On Tue, 22 Feb 2005 09:47:04 +0800, "Magix" <ma***@asia.com> wrote in
comp.lang.c++:

"Rolf Magnus" <ra******@t-online.de> wrote in message
news:cv*************@news.t-online.com...
Tim Love wrote:
"Magix" <ma***@asia.com> writes:

Hi,

I would like to convert a string to byte array.
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.


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. news:comp.os.ms-windows.programmer.win32 is quite
good.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.