at 3:28 this code is illustrated to explain this concept of access by square brakes, my humble question is. Why are there a pair of () after the square braker.
Vectors are awesome (A) the only downside is that they are dynamic and thus slow.... however if you only just initialize your vector from the start and than never change it again its just as fast as a normal array! :)
@yutuboslaven You must be thinking of another container class. It wouldn't make any sense for size() to be O(n) for vectors. It is O(1). If you need proof, here's the code from the MS 2010 library:
at 3:28 this code is illustrated to explain this concept of access by square brakes, my humble question is. Why are there a pair of () after the square braker.
omahdezavalos 1 day ago
"This concludes the lesson." What happened? :O
lleksikon 6 months ago
awesome....!!!
indianaronaldo 6 months ago
i don't get it
SheWasAlmost18 11 months ago
keep the c++ tutorials going!!!
you rock!
yoshinosakura 11 months ago 5
Nice tutorial, I had thought that you quit C++ tutorial's.
TyRATnt 11 months ago
Vectors are awesome (A) the only downside is that they are dynamic and thus slow.... however if you only just initialize your vector from the start and than never change it again its just as fast as a normal array! :)
PleeDuck 11 months ago
@PleeDuck slow? slower than what?
Peterolen 4 months ago
whats a vector?
greenpogo 11 months ago
better use i != (c).end() instead i!=(c).size(), because end() is a O(1) function and size() is a O(n) function.
yutuboslaven 11 months ago
@yutuboslaven You must be thinking of another container class. It wouldn't make any sense for size() to be O(n) for vectors. It is O(1). If you need proof, here's the code from the MS 2010 library:
size_type size() const
{ return (this->_Mylast - this->_Myfirst);
}
xoaxdotnet 11 months ago
@xoaxdotnet
Thx!
yutuboslaven 11 months ago
is this for c++ 2010
darpop220 11 months ago
finally new C++ vid :)
valajbeg 11 months ago
i hate to use vectors... its easyer to make a own vector class with a template
jorreerroj 11 months ago
You're videos are what got me interested in programming in C++. Now I already know all the information in your newer videos, this is weird ;)
Great videos by the way, keep it up!
CPUhacker24 11 months ago
Cheers for Lesson 50!
SavageEdits 11 months ago 9