---
title: "Discussion on \"Difference between vector<> and array() in C++\" | Hashnode"
description: "Discussion on \"Difference between vector<> and array() in C++\". In C++, both vectors and arrays are used to store collections of elements, but they have significant differences in terms of flexibility, functionality, and usage. Here's a comparison of the two:\nArrays\n\nStatic Size:\n\nThe size of an array must be kno..."
url: "https://hashnode.com/posts/difference-between-vector-and-array-in-c/6652e742ed72e98428166b36"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Difference between vector<> and array() in C++](https://viruscage.hashnode.dev/difference-between-vector-and-array-in-c?utm_source=hashnode&utm_medium=feed)

In C++, both vectors and arrays are used to store collections of elements, but they have significant differences in terms of flexibility, functionality, and usage. Here's a comparison of the two: Arrays Static Size: The size of an array must be kno...

May 26, 2024 · 3 min read · viruscage.hashnode.dev  
Read the article

-   [#cpp-ck4ra5k7300nlv2s1jbkdp2qh](https://hashnode.com/tag/cpp-ck4ra5k7300nlv2s1jbkdp2qh)
-   [#vector](https://hashnode.com/tag/vector)
-   [#array](https://hashnode.com/tag/array)
-   [#difference](https://hashnode.com/tag/difference)

## Written by

[Anindya Roy](https://hashnode.com/@onevirus)

@onevirus

  
[View profile](https://hashnode.com/@onevirus)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
