Skip to content

Commit 2943081

Browse files
author
mtx48109
committed
finished batch
1 parent 4939449 commit 2943081

27 files changed

Lines changed: 101 additions & 101 deletions

docs/cpp/additional-termination-considerations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: "mblome"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Additional Termination Considerations
15-
You can terminate a C++ program by using **exit**, `return`, or **abort**. You can add exit processing using the `atexit` function. These are discussed in the following sections.
15+
You can terminate a C++ program by using **exit**, **return**, or **abort**. You can add exit processing using the `atexit` function. These are discussed in the following sections.
1616

1717
## See Also
1818
[Startup and Termination](../cpp/startup-and-termination-cpp.md)

docs/cpp/aliases-and-typedefs-cpp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ ptr<int> ptr_int;
8080
```
8181

8282
## Example
83-
The following example demonstrates how to use an alias template with a custom allocator—in this case, an integer vector type. You can substitute any type for `int` to create a convenient alias to hide the complex parameter lists in your main functional code. By using the custom allocator throughout your code you can improve readability and reduce the risk of introducing bugs caused by typos.
83+
The following example demonstrates how to use an alias template with a custom allocator—in this case, an integer vector type. You can substitute any type for **int** to create a convenient alias to hide the complex parameter lists in your main functional code. By using the custom allocator throughout your code you can improve readability and reduce the risk of introducing bugs caused by typos.
8484

8585
```cpp
8686
#include <stdlib.h>
@@ -232,7 +232,7 @@ typedef char CHAR, *PSTR;
232232
typedef void DRAWF( int, int );
233233
```
234234
235-
After the above `typedef` statement, the declaration
235+
After the above **typedef** statement, the declaration
236236
237237
```
238238
DRAWF box;
@@ -284,7 +284,7 @@ typedef char CHAR;
284284
#include "file2.h" // OK
285285
```
286286

287-
The program *PROG.CPP* includes two header files, both of which contain `typedef` declarations for the name `CHAR`. As long as both declarations refer to the same type, such redeclaration is acceptable.
287+
The program *PROG.CPP* includes two header files, both of which contain **typedef** declarations for the name `CHAR`. As long as both declarations refer to the same type, such redeclaration is acceptable.
288288

289289
A **typedef** cannot redefine a name that was previously declared as a different type. Therefore, if *FILE2.H* contains
290290

@@ -343,7 +343,7 @@ typedef struct {
343343
} POINT;
344344
```
345345

346-
The preceding example declares a class named `POINT` using the unnamed class `typedef` syntax. `POINT` is treated as a class name; however, the following restrictions apply to names introduced this way:
346+
The preceding example declares a class named `POINT` using the unnamed class **typedef** syntax. `POINT` is treated as a class name; however, the following restrictions apply to names introduced this way:
347347

348348
- The name (the synonym) cannot appear after a **class**, **struct**, or **union** prefix.
349349

docs/cpp/align-cpp.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ Writing applications that use the latest processor instructions introduces some
3232

3333
For information about how to return a value of type `size_t` that is the alignment requirement of the type, see [__alignof](../cpp/alignof-operator.md). For information about how to declare unaligned pointers when targeting 64-bit processors, see [__unaligned](../cpp/unaligned.md).
3434

35-
You can use `__declspec(align(#))` when you define a `struct`, `union`, or `class`, or when you declare a variable.
35+
You can use `__declspec(align(#))` when you define a **struct**, **union**, or **class**, or when you declare a variable.
3636

3737
The compiler does not guarantee or attempt to preserve the alignment attribute of data during a copy or data transform operation. For example, [memcpy](../c-runtime-library/reference/memcpy-wmemcpy.md) can copy a struct declared with `__declspec(align(#))` to any location. Note that ordinary allocators—for example, [malloc](../c-runtime-library/reference/malloc.md), C++ [operator new](new-operator-cpp.md), and the Win32 allocators—return memory that is usually not sufficiently aligned for `__declspec(align(#))` structures or arrays of structures. To guarantee that the destination of a copy or data transformation operation is correctly aligned, use [_aligned_malloc](../c-runtime-library/reference/aligned-malloc.md), or write your own allocator.
3838

3939
You cannot specify alignment for function parameters. When data that has an alignment attribute is passed by value on the stack, its alignment is controlled by the calling convention. If data alignment is important in the called function, copy the parameter into correctly aligned memory before use.
4040

41-
Without `__declspec(align(#))`, the compiler generally aligns data on natural boundaries based on the target processor and the size of the data, up to 4-byte boundaries on 32-bit processors, and 8-byte boundaries on 64-bit processors. Data in classes or structures is aligned in the class or structure at the minimum of its natural alignment and the current packing setting (from #pragma `pack` or the **/Zp** compiler option).
41+
Without `__declspec(align(#))`, the compiler generally aligns data on natural boundaries based on the target processor and the size of the data, up to 4-byte boundaries on 32-bit processors, and 8-byte boundaries on 64-bit processors. Data in classes or structures is aligned in the class or structure at the minimum of its natural alignment and the current packing setting (from #pragma **pack** or the **/Zp** compiler option).
4242

4343
This example demonstrates the use of `__declspec(align(#))`:
4444

@@ -87,7 +87,7 @@ The following examples show how `__declspec(align(#))` affects the size and alig
8787
#define CACHE_ALIGN __declspec(align(CACHE_LINE))
8888
```
8989

90-
In this example, the `S1` structure is defined by using `__declspec(align(32))`. All uses of `S1` for a variable definition or in other type declarations are 32-byte aligned. `sizeof(struct S1)` returns 32, and `S1` has 16 padding bytes following the 16 bytes required to hold the four integers. Each `int` member requires 4-byte alignment, but the alignment of the structure itself is declared to be 32. Therefore, the overall alignment is 32.
90+
In this example, the `S1` structure is defined by using `__declspec(align(32))`. All uses of `S1` for a variable definition or in other type declarations are 32-byte aligned. `sizeof(struct S1)` returns 32, and `S1` has 16 padding bytes following the 16 bytes required to hold the four integers. Each **int** member requires 4-byte alignment, but the alignment of the structure itself is declared to be 32. Therefore, the overall alignment is 32.
9191

9292
```cpp
9393
struct CACHE_ALIGN S1 { // cache align all instances of S1
@@ -167,7 +167,7 @@ void fn() {
167167
}
168168
```
169169

170-
The alignment when memory is allocated on the heap depends on which allocation function is called. For example, if you use `malloc`, the result depends on the operand size. If *arg* >= 8, the memory returned is 8 byte aligned. If *arg* < 8, the alignment of the memory returned is the first power of 2 less than *arg*. For example, if you use malloc(7), the alignment is 4 bytes.
170+
The alignment when memory is allocated on the heap depends on which allocation function is called. For example, if you use **malloc**, the result depends on the operand size. If *arg* >= 8, the memory returned is 8 byte aligned. If *arg* < 8, the alignment of the memory returned is the first power of 2 less than *arg*. For example, if you use malloc(7), the alignment is 4 bytes.
171171

172172
## <a name="vclrf_declspecaligntypedef"></a> Defining New Types with __declspec(align(#))
173173

@@ -207,7 +207,7 @@ __declspec(thread) struct S9 a;
207207

208208
## <a name="vclrfhowalignworkswithdatapacking"></a> How align Works with Data Packing
209209

210-
The **/Zp** compiler option and the `pack` pragma have the effect of packing data for structure and union members.This example shows how **/Zp** and `__declspec(align(#))` work together:
210+
The **/Zp** compiler option and the **pack** pragma have the effect of packing data for structure and union members.This example shows how **/Zp** and `__declspec(align(#))` work together:
211211

212212
```c[[]]
213213
struct S {
@@ -220,7 +220,7 @@ struct S {
220220
};
221221
```
222222

223-
The following table lists the offset of each member under a variety of **/Zp** (or #pragma `pack`) values, showing how the two interact.
223+
The following table lists the offset of each member under a variety of **/Zp** (or #pragma **pack**) values, showing how the two interact.
224224

225225
|Variable|/Zp1|/Zp2|/Zp4|/Zp8|
226226
|--------------|-----------|-----------|-----------|-----------|

docs/cpp/anonymous-class-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: "mblome"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Anonymous Class Types
15-
Classes can be anonymous — that is, they can be declared without an *identifier*. This is useful when you replace a class name with a `typedef` name, as in the following:
15+
Classes can be anonymous — that is, they can be declared without an *identifier*. This is useful when you replace a class name with a **typedef** name, as in the following:
1616

1717
```
1818
typedef struct
@@ -23,7 +23,7 @@ typedef struct
2323
```
2424

2525
> [!NOTE]
26-
> The use of anonymous classes shown in the previous example is useful for preserving compatibility with existing C code. In some C code, the use of `typedef` in conjunction with anonymous structures is prevalent.
26+
> The use of anonymous classes shown in the previous example is useful for preserving compatibility with existing C code. In some C code, the use of **typedef** in conjunction with anonymous structures is prevalent.
2727
2828
Anonymous classes are also useful when you want a reference to a class member to appear as though it were not contained in a separate class, as in the following:
2929

docs/cpp/argument-definitions.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,25 @@ int wmain( int argc, wchar_t* argv[], wchar_t* envp[]);
2222

2323
allow convenient command-line parsing of arguments and, optionally, access to environment variables. The argument definitions are as follows:
2424

25-
`argc`
26-
An integer that contains the count of arguments that follow in `argv`. The `argc` parameter is always greater than or equal to 1.
25+
*argc*
26+
An integer that contains the count of arguments that follow in *argv*. The *argc* parameter is always greater than or equal to 1.
2727

28-
`argv`
29-
An array of null-terminated strings representing command-line arguments entered by the user of the program. By convention, `argv`**[0]** is the command with which the program is invoked, `argv`**[1]** is the first command-line argument, and so on, until `argv`**[**`argc`**]**, which is always **NULL**. See [Customizing Command Line Processing](../cpp/customizing-cpp-command-line-processing.md) for information on suppressing command-line processing.
28+
*argv*
29+
An array of null-terminated strings representing command-line arguments entered by the user of the program. By convention, `argv`**[0]** is the command with which the program is invoked, `argv`**[1]** is the first command-line argument, and so on, until `argv`**[**`argc`**]**, which is always NULL. See [Customizing Command Line Processing](../cpp/customizing-cpp-command-line-processing.md) for information on suppressing command-line processing.
3030

3131
The first command-line argument is always `argv`**[1]** and the last one is `argv`**[**`argc` - 1**]**.
3232

3333
> [!NOTE]
3434
> By convention, `argv`**[0]** is the command with which the program is invoked. However, it is possible to spawn a process using [CreateProcess](http://msdn.microsoft.com/library/windows/desktop/ms683197) and if you use both the first and second arguments (`lpApplicationName` and `lpCommandLine`), `argv`**[0]** may not be the executable name; use [GetModuleFileName](http://msdn.microsoft.com/library/windows/desktop/ms683197) to retrieve the executable name, and its fully-qualified path.
3535
3636
## Microsoft Specific
37-
`envp`
38-
The `envp` array, which is a common extension in many UNIX systems, is used in Microsoft C++. It is an array of strings representing the variables set in the user's environment. This array is terminated by a **NULL** entry. It can be declared as an array of pointers to **char (char** \*envp[ ]**)** or as a pointer to pointers to **char (char** \*\*envp**)**. If your program uses **wmain** instead of **main**, use the `wchar_t` data type instead of `char`. The environment block passed to **main** and **wmain** is a "frozen" copy of the current environment. If you subsequently change the environment via a call to **putenv** or `_wputenv`, the current environment (as returned by `getenv`/`_wgetenv` and the `_environ`/ `_wenviron` variable) will change, but the block pointed to by envp will not change. See [Customizing Command Line Processing](../cpp/customizing-cpp-command-line-processing.md) for information on suppressing environment processing. This argument is ANSI compatible in C, but not in C++.
37+
*envp*
38+
The *envp* array, which is a common extension in many UNIX systems, is used in Microsoft C++. It is an array of strings representing the variables set in the user's environment. This array is terminated by a NULL entry. It can be declared as an array of pointers to **char (char** \*envp[ ]**)** or as a pointer to pointers to **char (char** \*\*envp**)**. If your program uses **wmain** instead of **main**, use the **wchar_t** data type instead of **char**. The environment block passed to **main** and **wmain** is a "frozen" copy of the current environment. If you subsequently change the environment via a call to **putenv** or `_wputenv`, the current environment (as returned by `getenv`/`_wgetenv` and the `_environ`/ `_wenviron` variable) will change, but the block pointed to by envp will not change. See [Customizing Command Line Processing](../cpp/customizing-cpp-command-line-processing.md) for information on suppressing environment processing. This argument is ANSI compatible in C, but not in C++.
3939

4040
**END Microsoft Specific**
4141

4242
## Example
43-
The following example shows how to use the `argc`, `argv`, and `envp` arguments to **main**:
43+
The following example shows how to use the *argc*, *argv*, and *envp* arguments to **main**:
4444

4545
```
4646
// argument_definitions.cpp

docs/cpp/arrays-cpp.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ decl-specifier identifier [ constant-expression ]
2727

2828
- An optional storage class specifier.
2929

30-
- Optional **const** and/or `volatile` specifiers.
30+
- Optional **const** and/or **volatile** specifiers.
3131

3232
- The type name of the elements of the array.
3333

3434
2. The declarator:
3535

3636
- The identifier.
3737

38-
- A constant expression of integral type enclosed in brackets, **[].** If multiple dimensions are declared using additional brackets, the constant expression may be omitted on the first set of brackets.
38+
- A constant expression of integral type enclosed in brackets, **[]**. If multiple dimensions are declared using additional brackets, the constant expression may be omitted on the first set of brackets.
3939

4040
- Optional additional brackets enclosing constant expressions.
4141

4242
3. An optional initializer. See [Initializers](../cpp/initializers.md).
4343

44-
The number of elements in the array is given by the constant expression. The first element in the array is the 0th element, and the last element is the (*n*-1) element, where *n* is the number of elements the array can contain. The *constant-expression* must be of an integral type and must be greater than 0. A zero-sized array is legal only when the array is the last field in a `struct` or **union** and when the Microsoft extensions (/Ze) are enabled.
44+
The number of elements in the array is given by the constant expression. The first element in the array is the 0th element, and the last element is the (*n*-1) element, where *n* is the number of elements the array can contain. The *constant-expression* must be of an integral type and must be greater than 0. A zero-sized array is legal only when the array is the last field in a **struct** or **union** and when the Microsoft extensions (/Ze) are enabled.
4545

4646
The following example shows how to define an array at run time:
4747

@@ -66,15 +66,15 @@ int main() {
6666
}
6767
```
6868

69-
Arrays are derived types and can therefore be constructed from any other derived or fundamental type except functions, references, and `void`.
69+
Arrays are derived types and can therefore be constructed from any other derived or fundamental type except functions, references, and **void**.
7070

7171
Arrays constructed from other arrays are multidimensional arrays. These multidimensional arrays are specified by placing multiple bracketed constant expressions in sequence. For example, consider this declaration:
7272

7373
```
7474
int i2[5][7];
7575
```
7676

77-
It specifies an array of type `int`, conceptually arranged in a two-dimensional matrix of five rows and seven columns, as shown in the following figure:
77+
It specifies an array of type **int**, conceptually arranged in a two-dimensional matrix of five rows and seven columns, as shown in the following figure:
7878

7979
![Conceptual layout of a multi&#45;dimensional array](../cpp/media/vc38rc1.gif "vc38RC1")
8080
Conceptual Layout of Multidimensional Array

docs/cpp/assertion-and-user-supplied-messages-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The C++ language supports three error handling mechanisms that help you debug yo
2323

2424
The `static_assert` declaration is especially useful for debugging templates because template arguments can be included in the user-specified expression.
2525

26-
- The [assert Macro, _assert, _wassert](../c-runtime-library/reference/assert-macro-assert-wassert.md) macro is in effect at run time. It evaluates a user-specified expression, and if the result is zero, the system issues a diagnostic message and closes your application. Many other macros, such as[_ASSERT](../c-runtime-library/reference/assert-asserte-assert-expr-macros.md) and `_ASSERTE`, resemble this macro but issue different system-defined or user-defined diagnostic messages.
26+
- The [assert Macro, _assert, _wassert](../c-runtime-library/reference/assert-macro-assert-wassert.md) macro is in effect at run time. It evaluates a user-specified expression, and if the result is zero, the system issues a diagnostic message and closes your application. Many other macros, such as[_ASSERT](../c-runtime-library/reference/assert-asserte-assert-expr-macros.md) and _ASSERTE, resemble this macro but issue different system-defined or user-defined diagnostic messages.
2727

2828
## See Also
2929
[#error Directive (C/C++)](../preprocessor/hash-error-directive-c-cpp.md)

docs/cpp/assignment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ ms.workload: ["cplusplus"]
1414
# Assignment
1515
The assignment operator (**=**) is, strictly speaking, a binary operator. Its declaration is identical to any other binary operator, with the following exceptions:
1616

17-
- It must be a nonstatic member function. No `operator=` can be declared as a nonmember function.
17+
- It must be a nonstatic member function. No **operator=** can be declared as a nonmember function.
1818

1919
- It is not inherited by derived classes.
2020

21-
- A default `operator=` function can be generated by the compiler for class types if none exists. (For more information about default `operator=` functions, see [Memberwise Assignment and Initialization](http://msdn.microsoft.com/en-us/94048213-8b49-4416-8069-b1b7a6f271f9).)
21+
- A default **operator=** function can be generated by the compiler for class types if none exists. (For more information about default **operator=** functions, see [Memberwise Assignment and Initialization](http://msdn.microsoft.com/en-us/94048213-8b49-4416-8069-b1b7a6f271f9).)
2222

2323
The following example illustrates how to declare an assignment operator:
2424

0 commit comments

Comments
 (0)