Telegramy
Articles
About
« Rev
@programminginc
1078
Fwd »
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
A beginner understands what most high level programming languages means by arrays
yes
kapil
Also be wary of the book Let Us C (16th Edition, 2017) by Yashwant Kanetkar. Some people view it as a horribly outdated book that teaches Turbo C and has lot of obsolete, misleading and downright incorrect material.
Just checked. I have 15th edition.
BinaryByter
thats enough until you dig deeper
Ariana
lol
Ariana
thats worse
Anonymous
yes
And this is important.
BinaryByter
yea
Ariana
https://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list
just read this pls
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!
Zeus
std::vector
No
Ariana
You can literally treat it as declaring many vars at once for that matter
.
Zeus
You can literally treat it as declaring many vars at once for that matter
Yes
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;
klimi
std::vector is litterally a wrapper around c-arrays that do what you wantex
Why there is an STD:array then
Ariana
with just some pointery diff
Zeus
std::vector is litterally a wrapper around c-arrays that do what you wantex
How do u do the same thing in java??
BinaryByter
Why there is an STD:array then
std::array is fixed size
BinaryByter
How do u do the same thing in java??
linked lists
Zeus
Array that change size?
klimi
std::array is fixed size
So better performance?
Ariana
Use exploding arrays
Zeus
linked lists
Woahhh
BinaryByter
So better performance?
yes
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
BinaryByter
i quit java after 1hr mdr
^^^
Ariana
i quit java after 1hr mdr
or less
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
BinaryByter
I suggest halfing its size when it reaches 1/4 capacity
i suggest never doing that
Ariana
*=2 is most efficient i tot
Ariana
i suggest never doing that
why tho
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
BinaryByter
like youll be left with a lot of random useless mem
delete takes some time
Ariana
Linked list sucks anyways
BinaryByter
*=const then
yes
Ariana
just dont use them
Ariana
delete takes some time
Nah
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
Shruti
Suggest me some best practice book for c++😁
Same for me
BinaryByter
Suggest me some best practice book for c++😁
the C++ primer is said to be good
Ariana
the implem in clinl uses malloc and copying
if heap is nearly full?
« Rev
@programminginc
1078
Fwd »