Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions concepts/vector-arrays/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Arrays also need a size.
Look at these examples to see the two container types' initializations:

```cpp
#include<array>
#include <array>
#include <string>

// std::array variable_name<element_type, size> {list of elements}
// std::array<element_type, size> variable_name {list of elements}
std::array<std::string, 3> indie_rock {"yeah", "yeah", "yeah"};
// indie_rock contains the elements "yeah" three times
```
Expand All @@ -24,10 +24,10 @@ Vectors usually need more space, as they allocate memory for further growth.
You do not need to specify a size:

```cpp
#include<vector>
#include <vector>

// std::vector variable_name<element_type> {list of elements}
std::vector countdown<int> {3, 2, 1};
// std::vector<element_type> variable_name {list of elements}
std::vector<int> countdown {3, 2, 1};
// my_vector contains the elements 3, 2 and 1
```

Expand Down
2 changes: 1 addition & 1 deletion concepts/vector-arrays/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Look at these examples to see the two container types' initializations:
#include <array>
#include <string>

// std::array variable_name<element_type, size> {list of elements}
// std::array<element_type, size> variable_name {list of elements}
std::array<std::string, 3> indie_rock {"yeah", "yeah", "yeah"};
// indie_rock contains the elements "yeah" three times
```
Expand Down