Skip to content

Commit df22218

Browse files
authored
Merge pull request #4835 from MicrosoftDocs/FromPublicMasterBranch
Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main)
2 parents 6f16651 + f0bca2f commit df22218

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

docs/assembler/masm/masm-bnf-grammar.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The BNF grammar allows recursive definitions. For example, the grammar uses *`qu
2222
  *`endOfLine`* | *`comment`*
2323

2424
*`=Dir`*\
25-
  *`id`* = *`immExpr`* *`;;`*
25+
  *`id`* **`=`** *`immExpr`* *`;;`*
2626

2727
*`addOp`*\
2828
  **`+`** | **`-`**
@@ -492,7 +492,7 @@ The BNF grammar allows recursive definitions. For example, the grammar uses *`qu
492492
  *`immExpr`*\
493493
  | *`string`*\
494494
  | **`?`**\
495-
  | *`constExpr`* **`DUP`** ( *`scalarInstList`* )\
495+
  | *`constExpr`* **`DUP`** **`(`** *`scalarInstList`* **`)`**\
496496
  | *`floatNumber`*\
497497
  | *`bcdConst`*
498498

@@ -591,7 +591,7 @@ The BNF grammar allows recursive definitions. For example, the grammar uses *`qu
591591

592592
*`macroCall`*\
593593
  *`id`* *`macroArgList`* *`;;`*\
594-
  | *`id`* ( *`macroArgList`* )
594+
  | *`id`* **`(`** *`macroArgList`* **`)`**
595595

596596
*`macroDir`*\
597597
  *`id`* **`MACRO`***`macroParmList`**`;;`*\
@@ -716,7 +716,7 @@ The BNF grammar allows recursive definitions. For example, the grammar uses *`qu
716716
  | **`OLDMACROS`** | **`NOOLDMACROS`**\
717717
  | **`OLDSTRUCTS`** | **`NOOLDSTRUCTS`**\
718718
  | **`PROC`** **`:`** *`oVisibility`*\
719-
  | **`PROLOGUE`** : *`macroId`*\
719+
  | **`PROLOGUE`** **`:`** *`macroId`*\
720720
  | **`READONLY`** | **`NOREADONLY`**\
721721
  | **`SCOPED`** | **`NOSCOPED`**\
722722
  | **`SEGMENT`** **`:`** *`segSize`*\

docs/atl/reference/compiler-options-macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ _ATL_FREE_THREADED
122122

123123
Specifies free threading. Free threading is equivalent to a multithread apartment model. See [Specifying the Project's Threading Model](../../atl/specifying-the-threading-model-for-a-project-atl.md) for other threading options, and [Options, ATL Simple Object Wizard](../../atl/reference/options-atl-simple-object-wizard.md) for a description of the threading models available for an ATL object.
124124

125-
## <a name="_ATL_MODULES"></a> `_ATLMODULES`
125+
## <a name="_ATL_MODULES"></a> `_ATL_MODULES`
126126

127127
Allows you to compile ATL projects with [`permissive-`](../../build/reference/permissive-standards-conformance.md) and use ATL with [C++ modules](../../cpp/modules-cpp.md).
128128

docs/cpp/const-cpp.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int main()
147147
148148
## C and C++ `const` differences
149149
150-
When you declare a variable as **`const`** in a C source code file, you do so as:
150+
When you define a **`const`** variable in a C source code file, you do so as:
151151
152152
```C
153153
const int i = 2;
@@ -159,13 +159,18 @@ You can then use this variable in another module as follows:
159159
extern const int i;
160160
```
161161

162-
But to get the same behavior in C++, you must declare your **`const`** variable as:
162+
But to get the same behavior in C++, you must define your **`const`** variable as:
163163

164164
```cpp
165165
extern const int i = 2;
166166
```
167+
Similar to C, you can then use this variable in another module as follows:
167168

168-
If you wish to declare an **`extern`** variable in a C++ source code file for use in a C source code file, use:
169+
```cpp
170+
extern const int i;
171+
```
172+
173+
If you wish to define an **`extern`** variable in a C++ source code file for use in a C source code file, use:
169174

170175
```cpp
171176
extern "C" const int x=10;

docs/cpp/left-shift-and-right-shift-operators-input-and-output.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ The bitwise shift operators are the right-shift operator (**`>>`**), which moves
1313
## Syntax
1414

1515
*`shift-expression`*:\
16-
&emsp *`additive-expression`*\
17-
&emsp *`shift-expression`* **`<<`** *`additive-expression`*\
18-
&emsp *`shift-expression`* **`>>`** *`additive-expression`*
16+
&emsp;*`additive-expression`*\
17+
&emsp;*`shift-expression`* **`<<`** *`additive-expression`*\
18+
&emsp;*`shift-expression`* **`>>`** *`additive-expression`*
1919

2020
## Remarks
2121

docs/get-started/tutorial-console-cpp.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ If you build and run the code again at this point, it will still exit after aski
232232
{
233233
cin >> x >> oper >> y;
234234
result = c.Calculate(x, oper, y);
235-
cout << "Result is: " << result << endl;
235+
cout << "Result "<<"of "<< x << oper << y <<" is : "<< result << endl;
236236
}
237237

238238
return 0;
@@ -602,7 +602,7 @@ If you build and run the code again at this point, it will still exit after aski
602602
{
603603
cin >> x >> oper >> y;
604604
result = c.Calculate(x, oper, y);
605-
cout << "Result is: " << result << endl;
605+
cout << "Result"<<" of "<< x << oper << y <<" is : "<< result << endl;
606606
}
607607

608608
return 0;
@@ -716,13 +716,14 @@ Let's handle division by zero more gracefully, so a user can understand the prob
716716
if (oper == '/' && y == 0)
717717
{
718718
cout << "Division by 0 exception" << endl;
719+
cout << "Math error: Attempted to divide by Zero! "<<endl;
719720
continue;
720721
}
721722
else
722723
{
723724
result = c.Calculate(x, oper, y);
724725
}
725-
cout << "Result is: " << result << endl;
726+
cout << "Result"<<" of "<< x << oper << y <<" is : "<< result << endl;
726727
}
727728

728729
return 0;

0 commit comments

Comments
 (0)