Skip to content

Commit ee91cc4

Browse files
authored
Merge pull request #4965 from MicrosoftDocs/main
6/29/2023 10:30AM Publishing
2 parents 122f658 + 48b8d95 commit ee91cc4

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

docs/build/x64-calling-convention.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ ms.date: 05/17/2022
77

88
This section describes the standard processes and conventions that one function (the caller) uses to make calls into another function (the callee) in x64 code.
99

10+
For more information on the `__vectorcall` calling convention, see [__vectorcall](../cpp/vectorcall.md).
11+
1012
## Calling convention defaults
1113

1214
The x64 Application Binary Interface (ABI) uses a four-register fast-call calling convention by default. Space is allocated on the call stack as a shadow store for callees to save those registers.

docs/dotnet/for-each-in.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
22
title: "for each, in"
3-
description: "C++/CLI for each, in statement description and examples."
4-
ms.date: 04/15/2022
3+
description: "C++/CLI for each, in, statement descriptions and examples."
4+
ms.date: 06/29/2023
55
ms.topic: "reference"
66
f1_keywords: ["cliext::foreach", "each_CPP", "in_CPP", "for each_CPP", "for each", "in"]
77
helpviewer_keywords: ["for each keyword [C++]"]
8-
ms.assetid: 0c3a364b-2747-43f3-bb8d-b7d3b7023f79
98
---
109
# `for each`, `in`
1110

12-
Iterates through an array or collection. This non-standard keyword is available in both C++/CLI and native C++ projects. However, its use isn't recommended. Consider using a standard [Range-based for Statement (C++)](../cpp/range-based-for-statement-cpp.md) instead.
11+
Iterates through an array or collection. This nonstandard keyword is available in both C++/CLI and native C++ projects. However, using a standard [Range-based for Statement (C++)](../cpp/range-based-for-statement-cpp.md) is preferred, instead.
1312

14-
## All Runtimes
13+
## All runtimes
1514

1615
### Syntax
1716

@@ -57,29 +56,34 @@ This example shows how to use `for each` to iterate through a string.
5756
#include <stdio.h>
5857
using namespace Platform;
5958

60-
ref struct MyClass {
59+
ref struct MyClass
60+
{
6161
property String^ MyStringProperty;
6262
};
6363

64-
int main() {
64+
int main()
65+
{
6566
String^ MyString = ref new String("abcd");
6667

6768
for each ( char c in MyString )
69+
{
6870
wprintf("%c", c);
71+
}
6972

70-
wprintf("/n");
73+
wprintf("\n");
7174

7275
MyClass^ x = ref new MyClass();
7376
x->MyStringProperty = "Testing";
7477

7578
for each( char c in x->MyStringProperty )
79+
{
7680
wprintf("%c", c);
81+
}
7782
}
7883
```
7984

8085
```Output
8186
abcd
82-
8387
Testing
8488
```
8589

@@ -107,29 +111,34 @@ This example shows how to use `for each` to iterate through a string.
107111
// compile with: /clr
108112
using namespace System;
109113

110-
ref struct MyClass {
114+
ref struct MyClass
115+
{
111116
property String ^ MyStringProperty;
112117
};
113118

114-
int main() {
119+
int main()
120+
{
115121
String ^ MyString = gcnew String("abcd");
116122

117123
for each ( Char c in MyString )
124+
{
118125
Console::Write(c);
126+
}
119127

120128
Console::WriteLine();
121129

122-
MyClass ^ x = gcnew MyClass();
130+
MyClass ^x = gcnew MyClass();
123131
x->MyStringProperty = "Testing";
124132

125133
for each( Char c in x->MyStringProperty )
134+
{
126135
Console::Write(c);
136+
}
127137
}
128138
```
129139

130140
```Output
131141
abcd
132-
133142
Testing
134143
```
135144

0 commit comments

Comments
 (0)