Ariana
You can literally treat it as declaring many vars at once for that matter
Anonymous
depends on what you understand behind "arrays"
A beginner understands what most high level programming languages means by arrays
BinaryByter
thats enough until you dig deeper
Ariana
lol
Ariana
thats worse
Anonymous
yes
And this is important.
BinaryByter
yea
BinaryByter
what I meant was "you don't need to understand that arrays really are pointers behind the scenes"
kapil
just read this pls
Yes, checking that as well. Thanks
Anonymous
what I meant was "you don't need to understand that arrays really are pointers behind the scenes"
Thats true. But to a beginner your suggestion sounded like "You don't need to understand arrays when you're not a pro"
Anonymous
And that dangerous to say to newbes
Ariana
^
BinaryByter
Okay, fair point!
BinaryByter
No
std::vector is litterally a wrapper around c-arrays that do what you wantex
Ariana
Like when you do int a[5]; it is basically same as int a,b,c,d,e;
Ariana
with just some pointery diff
BinaryByter
Why there is an STD:array then
std::array is fixed size
Zeus
Array that change size?
klimi
std::array is fixed size
So better performance?
Ariana
Use exploding arrays
Ariana
Linked list suck
Ariana
A lot
Ariana
Like
klimi
yes
Ah i see
BinaryByter
Use exploding arrays
exploding arrays?
Ariana
I dont get the poibt
Ariana
ok basically when you overflow you double the size
Ariana
It is much much better
BinaryByter
but you can't double the size in java
Ariana
More space and time efficient
Ariana
Realloc
Ariana
Ok screw jaba
BinaryByter
java has realloc?
Ariana
idk
Ariana
it should hav something similar rite
BinaryByter
prolly not
BinaryByter
java doesnt have pointers
Ariana
i quit java after 1hr mdr
Zeus
Ok screw jaba
True I like c++ more than java
Ariana
exploding arrays is still best option imo
Ariana
Get a thing that doubles its size everytime it needs more size
BinaryByter
thats what std::vector does
Ariana
I suggest halfing its size when it reaches 1/4 capacity
BinaryByter
well in MSCV it does size *= 1.5
Ariana
*=2 is most efficient i tot
Ariana
like youll be left with a lot of random useless mem
BinaryByter
*=2 is most efficient i tot
you want to keep space efficiency as well
Zeus
Suggest me some best practice book for c++😁
Ariana
Hmm
Ariana
*=const then
Ariana
Linked list sucks anyways
BinaryByter
Ariana
just dont use them
BinaryByter
Linked list sucks anyways
only way to implement that in java
BinaryByter
Nah
depends on your memory pool implementation
Ariana
Literally just declare the space unallocated
Ariana
realloc should do it
Ariana
Its like O(1)
BinaryByter
oh right vector can use realloc 🤔
BinaryByter
the implem in clinl uses malloc and copying
BinaryByter
Suggest me some best practice book for c++😁
the C++ primer is said to be good