Topic: Help - want C++ generic linked-list class
Author: sctnugen@kraken.itc.gu.edu.au (Tony Nugent)
Date: 1 Feb 1994 16:10:46 +1000 Raw View
Help!
I need a source code for fully functional C++ generic linked-list
class.
I'm fairly new to C++ (but not to programming) and struggling to
build my own linked list class (it only really needs to be a
singly-linked class, but a doubly-linked list would be preferable).
Templates are NOT an easy thing to implement! (I keep getting
strange compiler errors, even though my code looks ok so far:
yes, I've read all the documentation and text books that I can,
no, I don't _really_ understand the finer points of it all; yes,
I've read the FAQ's).
Frustration is a common companion of the emerging programmer :)
I'm *sure* that this has been done before! (Of course it has:)
So, instead of re-inventing the wheel, can some kind soul send me
something that compiles, links, and works?
It needs to be able to compile and run under dos (I'm using
BC3.1) and unix (cc, gcc, g++, c++, and I think CC are available).
(BC3.1 does have a list class, but it is not suitable for my
needs, and I seriously doubt that it will compile under unix).
Specifically, I need to create objects that will link together
(fixed-length) strings of data. I also need methods to be able
to edit (ie, insert, delete, change) _characters_ in these
strings, but I could add these methods once I have the lists
working properly (in fact, I will eventually need to be able to
some really fancy things to this data). I then need another
object to manage multiple instances of these data lists (by
managing pointers to each of these lists).
This data engine will then become the central core of a
specialist scientific application I am building. (And then I
have to a build suitable user interface to it... and I'm _sure_
I'll be asking for help again when this happens:)
I have looked at the Simtel and garbo ftp sites for any useful
code, but what I have seen there either does not compile properly
or is not suitable for my needs.
I would be _very_ grateful for any help in obtaining suitable
source code (and docs) that will either compile and run
right-out-of-the-box, or will help me go along way with what I've
done so far.
Many thanks in advance,
Tony
--
/--------------------------------------------------------------\
/ _ \ Tony Nugent Email: T.Nugent@sct.gu.edu.au \ _
\_@) \ Griffith University Brisbane Queensland Australia \ (_@ \
\____________________________________________________________\___/