Follow us on Twitter!
The important thing is not to stop questioning. - Albert Einstein
Monday, April 21, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 27
Guests Online: 24
Members Online: 3

Registered Members: 82857
Newest Member: varshith_kh
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

C++ blocks

buddywithgol
Member



Posts: 84
Location: behind tor
Joined: 08.01.12
Rank:
Newbie
Warn Level: 30
Posted on 10-03-12 04:00
Can anyone explain to me what is a vector in C++ in layman's term?
Don't paste a part of a article to me, because that'd be useless


all good thing must come to an end, aka your computer.


www.imagenesanimadas.net/Informatica/Virus/virus10.gif
www.h4xer.com
Author

RE: C++ blocks

Mb0742
Member



Posts: 198
Location:
Joined: 26.11.07
Rank:
Apprentice
Posted on 10-03-12 08:09
Laymen terms it is similar to an array in a scripting language. Why?

Because c* arrays cannot be appended to and a vector you can.


Mb
javascript:alert("hi")
Author

RE: C++ blocks

Arabian
Banned



Posts: 332
Location: inside you.
Joined: 22.09.10
Rank:
Apprentice
Posted on 12-03-12 06:42
In laymen's terms? Vector is a fancy term for dynamic array, which is a data structure similar to an array list, though with slightly different functionality, log time, and methods that make it better option in some situations, and should be considered a tertiary structure in the vein of linked lists and balanced trees.


G'bye y'all! I was an asshole, So korg banned me.

Edited by Arabian on 12-03-12 06:43
Author

RE: C++ blocks

ellipsis
Member



Posts: 173
Location:
Joined: 13.06.09
Rank:
Uber Elite
Posted on 17-03-12 01:15
buddywithgol wrote:
Can anyone explain to me what is a vector in C++ in layman's term?
Don't paste a part of a article to me, because that'd be useless


A vector is a collection of a specific type of items. An array is a set collection.

Vectors and arrays are similar because they both store items (of the same type); however, they are different because vectors can have any size while arrays have a set maximum capacity.

Therefore, vectors are "dynamic" because they can expand and contract when necessary.

In non-layman's terms: vectors are wrapped arrays.

In my personal experience, vectors are more useful and practical than arrays. If an application requires many arrays with large capacities, initializing these arrays will choke the program. With vectors, you may have as many "arrays" as you need and you don't need to initialize each place holder. So these vectors will expand as the program runs and various items are stored and removed, and so forth.


10000101
Author

RE: C++ blocks

Arabian
Banned



Posts: 332
Location: inside you.
Joined: 22.09.10
Rank:
Apprentice
Posted on 17-03-12 02:34
ellipsis wrote:
buddywithgol wrote:
Can anyone explain to me what is a vector in C++ in layman's term?
Don't paste a part of a article to me, because that'd be useless


A vector is a collection of a specific type of items. An array is a set collection.

Vectors and arrays are similar because they both store items (of the same type); however, they are different because vectors can have any size while arrays have a set maximum capacity.

Therefore, vectors are "dynamic" because they can expand and contract when necessary.

In non-layman's terms: vectors are wrapped arrays.

In my personal experience, vectors are more useful and practical than arrays. If an application requires many arrays with large capacities, initializing these arrays will choke the program. With vectors, you may have as many "arrays" as you need and you don't need to initialize each place holder. So these vectors will expand as the program runs and various items are stored and removed, and so forth.


Practical only in some situations. Obviously the context calls for different structures, and dynamic arrays/vectors are heavier weight than your average array.

Keep this in mind and here's a good link with some O(n) comparisons and functionality explanations:

Here.


G'bye y'all! I was an asshole, So korg banned me.