• 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: C Strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C Strings


  • Subject: Re: C Strings
  • From: Aren Villanueva <email@hidden>
  • Date: Tue, 21 Mar 2006 17:33:51 +1100

Using that line causes Xcode to pause execution, and run GDB.

I keep on accidentally sending straight to your email, rather than the cocoa dev mailing list.

Aren


On 21/03/2006, at 5:09 PM, John Stiles wrote:

Your problem isn't Cocoa related, you just need to use pointers properly.
Try
printf("%c %d\n", searchTerm[0], *searchTerm[0]);



Aren Villanueva wrote:
Here is the printf statement that I used:




printf("%c %d\n", searchTerm[0], searchTerm[0]);


where searchTerm is defined in the function arguments as

char *searchTerm[]

I put the NSString into the function via


strcpy(term,[[termToSearch stringValue] cStringUsingEncoding:NSASCIIStringEncoding]);


where "term" becomes the passed variable to the function searchDict();


So what is causing the irregularity with the ASCII code, if when using a normal char * array self defined in the code, it gives proper characters as well as proper ASCII codes.


ps. I posted the function code, but its under review by the moderator at the moment.

Aren
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com


This email sent to 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: 
 >re: C Strings (From: Aren Villanueva <email@hidden>)
 >Re: C Strings (From: John Stiles <email@hidden>)

  • Prev by Date: Re: How to split a big file ?
  • Next by Date: Cannot set date of a symlink using FSSetCatalogInfo()?
  • Previous by thread: Re: C Strings
  • Next by thread: Re: C Strings
  • Index(es):
    • Date
    • Thread