• 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: What's the difference between a C++ and ObjC String?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the difference between a C++ and ObjC String?


  • Subject: Re: What's the difference between a C++ and ObjC String?
  • From: Cameron Hayne <email@hidden>
  • Date: Fri, 1 Jul 2005 20:13:59 -0400


On 1-Jul-05, at 7:12 PM, Frederick C. Lee wrote:

I read that C strings are null terminated whereas C++ strings are not.
Which leads me to ask, is there any difference between C++ and ObjC strings?

You need to speak more precisely when talking about strings. There are a few different things that people refer to as strings - even within the context of one language.
In C, strings are arrays of characters terminated by null.
In C++ and ObjC, the same "C strings" exist as well, but there are also string objects - instances of a string class. In C++, the class is usually "string" and in ObjC, the class is usually NSString.


--
Cameron Hayne
email@hidden


_______________________________________________ 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
References: 
 >What's the difference between a C++ and ObjC String? (From: "Frederick C. Lee" <email@hidden>)

  • Prev by Date: NSNumberFormatter OS X v10.4 enhancements
  • Next by Date: Re: Categories give warning
  • Previous by thread: What's the difference between a C++ and ObjC String?
  • Next by thread: Re: What's the difference between a C++ and ObjC String?
  • Index(es):
    • Date
    • Thread