Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Converting string into character arrays

Reply
Thread Tools

Converting string into character arrays

 
 
kittykat
Guest
Posts: n/a
 
      12-01-2004
Hi,
I was just wondering how can I convert a String into a char array?

Your help would be greatly appreciated,
Thanx in advance.

 
Reply With Quote
 
 
 
 
Howard
Guest
Posts: n/a
 
      12-01-2004

"kittykat" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) lkaboutprogramming.com...
> Hi,
> I was just wondering how can I convert a String into a char array?
>
> Your help would be greatly appreciated,
> Thanx in advance.
>


That depends: what's a "String"? If you mean the class called "string",
first notice that it is spelled with a lower case "s", which is very
important in C++. And in that case, you can call the c_str() function in
the string class to get a pointer to the character array, from which you are
free to copy to your own char array if you need. If you mean some other,
third-party class called "String", then you'd be best off asking the
creators of that class, or reading their manual.

-Howard



 
Reply With Quote
 
 
 
 
kittykat
Guest
Posts: n/a
 
      12-01-2004
Thank you!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert string with control character in caret notation to realcontrol character string. Bart Vandewoestyne C Programming 8 09-25-2012 12:41 PM
Multidimensional arrays and arrays of arrays Philipp Java 21 01-20-2009 08:33 AM
8 bit character string to 16 bit character string Brand Bogard C Programming 8 05-28-2006 05:05 PM
STL: Converting a string into a list of string blrmaani C++ 4 04-27-2004 09:38 PM
XSLT: Converting a number into a character? Andrzej Jan Taramina XML 3 02-02-2004 04:56 PM



Advertisments