c++ nub here
Why is declaring a 2d vector such a fucking mess
they couldn't think of anything more intuitive thanstd::vector< std::vector< float > > item ( height, std::vector<float> ( width, 0 ) );?
Is there a better alternative?
Java
>>52193856
thanks for being helpful, I knew I shouldn't have asked this shithole.
>>52193856
I don't want to deal with class names a mile long
>>52194070
then your naming conventions are to blame, not java retard
That's not a "2d vector" you fucking moron. That's a dynamically sized list of dynamically sized lists of numbers.
Please invent a time machine then go back and abort yourself.
2d vector in c++:float twodvector[y][x]
>>52194070
>System.out.println();
Disgusting
>>52194710
dynamically sized list = vector
dynamically sized list * dynamically sized list = vector * vector = 2d vector
kill yourself
If you care that much you can typedef a shorter name
>>52194060
>posts a shrek meme picture
here's your you
Use the Go, Rob.
>>52196104
No, retard. That's a vector of vectors.
A dynamically sized list of dynamically sized lists does not replace 2d arrays. That's a data structure where each "row" has its own independent size and are all independently dynamically allocated and managed.
A "2d vector" (which is not fucking real terminology when talking about data structures, it's called a two-dimensional array, but OP is too fucking stupid to know that a "vector" in C++ is a dynamically sized array) is just two coordinates mapped on to a single array, i.e. a single array indexed using y*height+x, not thousands of independently allocated arrays