• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa-dev Digest, Vol 2, Issue 1018
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa-dev Digest, Vol 2, Issue 1018


  • Subject: Re: Cocoa-dev Digest, Vol 2, Issue 1018
  • From: Ben Kazez <email@hidden>
  • Date: Sat, 02 Jul 2005 10:25:37 -0400

On Jul 1, 2005, at 4:12 PM, Frederick C. Lee wrote:


I read that C strings are null terminated whereas C++ strings are not.


??

try
std::string my_string("with_c_string_initializer");

const char* my_c_string = my_string.c_str();

This doesn't mean that the internal representation is null- terminated. You're not guaranteed anything about the implementation of C++ strings, although you are guaranteed some big-O things about performance. This goes for all the STL classes, I believe (can someone check me on that?).


Ben
--
Ben Kazez
http://www.benkazez.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cocoa-dev Digest, Vol 2, Issue 1018
      • From: John Stiles <email@hidden>
    • Re: Cocoa-dev Digest, Vol 2, Issue 1018
      • From: Gen Kiyooka <email@hidden>
  • Prev by Date: Re: supporting applescript in cocoa
  • Next by Date: Re: Flat Button Controls in Tiger
  • Previous by thread: Re: supporting applescript in cocoa
  • Next by thread: Re: Cocoa-dev Digest, Vol 2, Issue 1018
  • Index(es):
    • Date
    • Thread