• 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: NSString array to -> char**
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString array to -> char**


  • Subject: Re: NSString array to -> char**
  • From: Seth Delackner <email@hidden>
  • Date: Tue, 18 Mar 2003 00:42:27 -0800

On Sunday, March 16, 2003, at 06:35 AM, Thomas Lachand-Robert wrote:
Le dimanche, 16 mars 2003, ` 05:23 Europe/Paris, Seth Delackner a icrit :

A, bonjour ami. Pardonne nous aux Etats Unis pour les actions des idiots dans notre gouvernement maintenant. Nous somme plusieurs qui detestent ce qui approche. (Et pardonne ma francais, ca fait trois ans dhs que j'ai vecu en France.

// now we have the strings lengths in front of the array, we want pointers instead
char *p = [data mutableBytes], *q=p;
while (k--) q++ = p + *(int*)q;
q = NULL; // NULL terminated array
return data; // that's all folks
}

OK, I am having difficulty understanding the code on that while line.

Did you mean:

while (k--) {
*q = (int)(p + *(int*)q);
q++;
}

q++ = p + *(int*)q is very foreign c to me. Isn't that assigning the element's address to the address of our index pointer (q)? Don't we want to store the new address in *q, not set q to point somewhere else? My c memory address arithmetic is pretty rusty.
_______________________________________________
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.
  • Follow-Ups:
    • Re: NSString array to -> char**
      • From: Thomas Lachand-Robert <email@hidden>
    • [OT] A different kind of French kiss (was Re: NSString array to -> char**)
      • From: petite_abeille <email@hidden>
References: 
 >Re: NSString array to -> char** (From: Thomas Lachand-Robert <email@hidden>)

  • Prev by Date: Re: Help Book Problems
  • Next by Date: Re: Java vs C/Objective-C performance question
  • Previous by thread: Re: NSString array to -> char**
  • Next by thread: [OT] A different kind of French kiss (was Re: NSString array to -> char**)
  • Index(es):
    • Date
    • Thread