TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG-DEVEL:40] Vector
On Tue, Feb 08, 2000 at 01:53:45PM -0600, erick@pagelab.net wrote:
> I am just starting to look online now, but if anyone knows, how do
> you use vector with primative data types e.g. int, double. Thanks.
Which vector are you talking about?
If you're talking about the C++ STL vector class, it's trivial,
just declare your vector to be vector<int>, or vector<double>.
If you're talking about Java, it's another story. You have to
store 'object' style representations of your primitive data types.
Luckily, there's things like java.lang.Integer, java.lang.Bool and (I'm
pretty sure) java.lang.Double to help you out. You basically have to
store these in your vector.
Also, the java.lang package is assumed to be imported, so you
shouldn't have to import by hand it or qualify your names.
Have fun (if at all possible),
--
Its name is Public Opinion. It is held in reverence. It settles everything.
Some think it is the voice of God. Loyalty to petrified opinion never yet
broke a chain or freed a human soul. ---Mark Twain
-- Eric Hopper (hopper@omnifarious.mn.org http://omnifarious.mn.org/~hopper) --
PGP signature