• 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: Converting NSString to char constant (answered)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting NSString to char constant (answered)


  • Subject: Re: Converting NSString to char constant (answered)
  • From: Clark Cox <email@hidden>
  • Date: Sat, 3 Jan 2004 01:36:48 -0500

On Jan 03, 2004, at 01:28, KLW wrote:

> Dear Mr. Cox:
>
> Thank you for your response. Just to reassure you, my program is set
> up such that the only possible results will be either 'C', 'N', 'I',
> or 'E' -- well within the ASCII range.
> But I hadn't thought of the possibility that there would be a problem,
> and I thank you for pointing it out. As it is, the solution actually
> doesn't work without the char cast. Perhaps I could have said:
> unichar cResult = (unichar)[resultAsNSString characterAtIndex:0]

You don't need any cast there, just write:

unichar cResult = [resultAsNSString characterAtIndex:0]

> ;
>
> Anyone know if I can use a unichar in a switch() case construct?

Yes, you can use any integer type with switch()

--
Clark S. Cox III
email@hidden
http://homepage.mac.com/clarkcox3/
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >RE: Converting NSString to char constant (answered) (From: KLW <email@hidden>)
 >Re: Converting NSString to char constant (answered) (From: Clark Cox <email@hidden>)
 >Re: Converting NSString to char constant (answered) (From: KLW <email@hidden>)

  • Prev by Date: Re: Converting NSString to char constant (answered)
  • Next by Date: Column & Page breaks in multible NSTextViews
  • Previous by thread: Re: Converting NSString to char constant (answered)
  • Next by thread: Re: Converting NSString to char constant (answered)
  • Index(es):
    • Date
    • Thread