res7c...@verizon.net wrote:
I like to implement and ArrayList like Java's and C# in C++
but I have no clue how to start
Well, the C++ standard library defines several different collection
class templates which are adequate for most purposes -- did you learn
about these before deciding that you have to implement your own? The
closest analogue to ArrayList is probably std::vector, because it's a
collection class implemented in terms of a contiguous block of memory
(an array).
I really don't want to use Managed C++ and use ArrayList that way - I
want to keep it "unmanaged"
You'll find that the culture of this group is fairly unsympathetic (at
times openly hostile) to nonstandard extensions such as Managed C++; as
such, most of us won't work very hard to decipher lingo specific to
such extensions. Do managed/unmanaged refer to, perhaps, garbage
collection or the lack thereof? C++ does not have garbage collection
(though of course it's possible to implement a GC system in C++), so I
guess that satisfies your desire to keep things "unmanaged."
Can anyone point me to a resource that can tell me how to do this?
Read up on the STL first, before deciding to roll your own. It's not
just a matter of reinventing the wheel -- proper use of at least the
basic STL containers is a fundamental C++ skill. Learning about them
is something every C++ programmer should do long before achieving the
necessary skill level to implement something analogous on his or her
own.
Get yourself a copy of Stroustrup's _The C++ Programming Language_.
For an online STL reference, see sgi.com/tech/stl (though beware of
their nonstandard extensions).
Luke