• 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: Wed, 22 Mar 2006 07:50:23 +1100

Ahh, so the most appropriate thing would be to re-define the function argument to const char. I guess I really should re-read up on my pointers again.

Aren


On 22/03/2006, at 12:03 AM, Alexander Dymerets wrote:

Aren Villanueva wrote:

dictEntry searchDict(char *searchTerm[])
                                  ^^^^^^^^^^^^^
searchTerm is an array of char*

printf("%c %d\n",searchTerm[count2], searchTerm[count2]);
So, searchTerm[count2] is char*, not a char.

I suppose the correct head of you function should be
dictEntry searchDict(const char *searchTerm)

Do you pay attention to the compiler warnings?

_______________________________________________ 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: 
 >C strings (From: Aren Villanueva <email@hidden>)
 >Re: C strings (From: Alexander Dymerets <email@hidden>)

  • Prev by Date: Re: Wake from sleep notifications and preventing idle sleep
  • Next by Date: Re: NSTask and authentication...I have to clarify my original question
  • Previous by thread: Re: C strings
  • Next by thread: re: C Strings
  • Index(es):
    • Date
    • Thread