Skip to content

Commit 361bff5

Browse files
author
mikeblome
committed
added links
1 parent 5407c65 commit 361bff5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/cpp/arrays-cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ms.assetid: 3f5986aa-485c-4ba4-9502-67e2ef924238
66
---
77
# Arrays (C++)
88

9-
An array is a sequence of objects of the same type that occupy a contiguous area of memory. Traditional C-style arrays are the source of many bugs, but are still very common especially in older code bases. In modern C++, we strongly recommend using std::vector or std::array instead of C-style arrays described in this section. Both of these standard library types store their elements as a contiguous block of memory but provide much greater type safety along with iterators that are guaranteed to point to a valid location within the sequence.
9+
An array is a sequence of objects of the same type that occupy a contiguous area of memory. Traditional C-style arrays are the source of many bugs, but are still very common especially in older code bases. In modern C++, we strongly recommend using [std::vector](../standard-library/vector-class.md) or [std::array](../standard-library/array-class.md) instead of C-style arrays described in this section. Both of these standard library types store their elements as a contiguous block of memory but provide much greater type safety along with iterators that are guaranteed to point to a valid location within the sequence. For more information, see [Containers (Modern C++)](containers-modern-cpp.md).
1010

11-
An array is initialized by using the [] operator after the variable name. The number of elements must be specified with a constant value. Individual elements in the array are accessed by the same [] operator.
11+
An array is initialized by using the [subscript operator \[\]](subscript-operator.md) after the variable name. The number of elements must be specified with a constant value. Individual elements in the array are accessed by the same **[]** operator.
1212

1313
```cpp
1414
int i[100] {0}; // an array of 100 ints all initialized to zero

docs/cpp/containers-modern-cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: "Containers (Modern C++)"
3-
ms.date: "01/18/2018"
3+
ms.date: "11/12/2019"
44
ms.topic: "conceptual"
55
---
66
# Containers (Modern C++)
77

8-
By default, use [vector](../standard-library/vector-class.md) as the preferred sequential container in C++. This is equivalent to `List<T>` in .NET languages.
8+
By default, use [std::vector](../standard-library/vector-class.md) as the preferred sequential container in C++. The performance of **std::vector** is comparable to C-style arrays in most scenarios and is far safer. **std::vector** is equivalent to `List<T>` in .NET languages.
99

1010
```cpp
1111
vector<string> apples;

0 commit comments

Comments
 (0)