Re: NSString array to -> char**
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.