Vectors? (The "dynamic array" type of vectors, not the "value and direction" type)

Hello everybody!
I have had a bit of programming experience with C++ but found it very hard to make anything else then simple “command line applications” with it.
So looking for some “beginner friendly GUI stuff”, I came across processing.

So far I have written some small programms, messing around with creating simple GUIs and stuff like that.

But there is one thing that seems to be “missing”.
Vectors!

I mean there is the PVector thing, but that is like an actual “vector” as in it has a value and a direction.
I mean the “dynamic array” thing that is called vector.

Is there such a thing?

Yes, I know about “Table” and that that is basically like a dynamic 2D array (you can add cols / rows during runtime).
But you can’t use custom classes /objects with that!

So, am I missing something obvious or is there no such thing in processing?
If that is the case, what else are you supposed to use to do things like handle multiple values in a dynamic array?

I am not sure if I know what a vector is (in your sense).

See also simpler IntDict, FloatDict, and StringDict classes.

Thanks for that quick reply!
This is what I mean: vector - C++ Reference
It’s a thing in C++, maybe it is just a thing there and not in other languages …

Does that array thing also work with “multidimensional arrays” (2 dimensional, 3 dimensional, …)?

ArrayList can do this but I think this is not very transparent.

But you can also use array

There are other data structures in Java that you can use here but they are not documented on the processing reference page. E.g. Collection or Iterable

1 Like

Ok …
I will try to use ArrayList then …

Thanks!

EDIT:
I just had a look at the documentation for ArrayList and it looks EXACTLY like what I was looking for!
Thanks again!

1 Like