From the course: CompTIA IT Fundamentals (FC0-U61) Cert Prep 3: Computer Maintenance and Troubleshooting, Databases, and Programming

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

AMA: Ask me anything about programming

AMA: Ask me anything about programming

- Hey Shannon! Wow, chapter 15 already? - Yes, I'm almost there. - Whoa, yay! - Few quick questions for you on this chapter. - Okay, okay. - Let's talk about arrays and vectors. - Okay. An array is a data structure of kind of a fixed size. Okay, let me give you an-- - What? - Let me give you an analogy. Imagine you have a deli, right? And there's a glass case in front of the cash register and in that case, there are five spots for five plates with sandwiches only, okay? So, the plates are always there. You can have five sandwiches, you can have more, none, it doesn't matter but there's always space for five. That's an array. It's a fixed size thing, right? A vector on the other hand, imagine the other deli case that's empty, and you can set it up so you can put two plates in there, or take those out and put one plate in there with sandwiches or three plates in. It's variable, right? So the difference…

Contents