Re: Writing a linked list
Re: Writing a linked list
- Subject: Re: Writing a linked list
- From: Andres Santiago Perez-Bergquist <email@hidden>
- Date: Fri, 21 Mar 2003 04:36:04 -0500
On Friday, March 21, 2003, at 12:19 AM, Britt Green wrote:
I'm trying to convert my C++ Linked List class into Obj C, to better
learn the latter. However I'm having a hard time finding assistance on
doing this. I was wondering if anyone could point me to any examples of
this, or at least tell me if I can embed a C-style struct as a private
data member in a class?
Thanks!
Britt
PS: I am aware of the NSArray class but I just want to write my own
linked list as an academic exercise.
If this were not just for learning Obj-C, but for production code, my
advice would be to just work in Obj-C++, and use either your existing
linked list or, even better, the STL list class. The STL really is an
amazing tool for organizing and manipulating just about any kind of
data you want, and is more than happy to be instantiated with elements
consisting of pointers to Obj-C objects. As a nice bonus, use of the
STL tends to significantly cut down on the amount of memory management
you need to worry about when working in C++.
-- Andres
_______________________________________________
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.