diff --git a/docs/c-language/c-comments.md b/docs/c-language/c-comments.md index aaa1c15a1e..bae1313137 100644 --- a/docs/c-language/c-comments.md +++ b/docs/c-language/c-comments.md @@ -1,9 +1,8 @@ --- -description: "Learn more about: C Comments" title: "C Comments" -ms.date: "06/25/2018" +description: "Learn more about: C Comments" +ms.date: 06/25/2018 helpviewer_keywords: ["code comments, C code", "comments, documenting code", "comments, C code", "/* */ comment delimiters", "comments"] -ms.assetid: 0f5f2825-e673-49e7-8669-94e2f5294989 --- # C Comments @@ -57,7 +56,7 @@ The Microsoft compiler also supports single-line comments preceded by two forwar // This is a valid comment ``` -Comments beginning with two forward slashes (**`//`**) are terminated by the next newline character that isn't preceded by an escape character. In the next example, the newline character is preceded by a backslash (**`\`**), creating an "escape sequence." This escape sequence causes the compiler to treat the next line as part of the previous line. (For more information, see [Escape Sequences](../c-language/escape-sequences.md).) +Comments beginning with two forward slashes (**`//`**) are terminated by the next newline character that isn't preceded by an escape character. In the next example, the newline character is preceded by a backslash (**`\`**), creating an "escape sequence." This escape sequence causes the compiler to treat the next line as part of the previous line. For more information, see [Escape Sequences](../c-language/escape-sequences.md). ```C // my comment \ diff --git a/docs/c-language/initializing-scalar-types.md b/docs/c-language/initializing-scalar-types.md index 77c5673825..bcd7ca93c1 100644 --- a/docs/c-language/initializing-scalar-types.md +++ b/docs/c-language/initializing-scalar-types.md @@ -1,9 +1,8 @@ --- -description: "Learn more about: Initializing Scalar Types" title: "Initializing Scalar Types" -ms.date: "11/04/2016" +description: "Learn more about: Initializing Scalar Types" +ms.date: 11/04/2016 helpviewer_keywords: ["initializing scalar types", "register variables", "initialization, scalar types", "initializing variables, scalar types", "scalar types", "static variables, initializing", "automatic storage class, initializing scalar types", "automatic storage class", "types [C], initializing"] -ms.assetid: 73c516f5-c3ad-4d56-ab3b-f2a82b621104 --- # Initializing Scalar Types @@ -38,7 +37,7 @@ You can initialize variables of any type, as long as you obey the following rule - Variables declared with the **`auto`** or **`register`** storage-class specifier are initialized each time execution control passes to the block in which they're declared. If you omit an initializer from the declaration of an **`auto`** or **`register`** variable, the initial value of the variable is undefined. For automatic and register values, the initializer isn't restricted to being a constant; it can be any expression involving previously defined values, even function calls. -- The initial values for external variable declarations and for all **`static`** variables, whether external or internal, must be constant expressions. (For more information, see [Constant Expressions](../c-language/c-constant-expressions.md).) Since the address of any externally declared or static variable is constant, it can be used to initialize an internally declared **`static`** pointer variable. However, the address of an **`auto`** variable can't be used as a static initializer because it may be different for each execution of the block. You can use either constant or variable values to initialize **`auto`** and **`register`** variables. +- The initial values for external variable declarations and for all **`static`** variables, whether external or internal, must be constant expressions. For more information, see [Constant Expressions](../c-language/c-constant-expressions.md). Since the address of any externally declared or static variable is constant, it can be used to initialize an internally declared **`static`** pointer variable. However, the address of an **`auto`** variable can't be used as a static initializer because it may be different for each execution of the block. You can use either constant or variable values to initialize **`auto`** and **`register`** variables. - If the declaration of an identifier has block scope, and the identifier has external linkage, the declaration can't have an initialization. diff --git a/docs/c-language/l-value-and-r-value-expressions.md b/docs/c-language/l-value-and-r-value-expressions.md index cca7a68bf2..5a646ce54d 100644 --- a/docs/c-language/l-value-and-r-value-expressions.md +++ b/docs/c-language/l-value-and-r-value-expressions.md @@ -1,9 +1,8 @@ --- -description: "Learn more about: L-Value and R-Value Expressions" title: "L-Value and R-Value Expressions" -ms.date: "11/04/2016" +description: "Learn more about: L-Value and R-Value Expressions" +ms.date: 11/04/2016 helpviewer_keywords: ["L-values", "member-selection expressions", "R-value expressions", "subscript expressions"] -ms.assetid: b790303e-ec6f-4d0d-bc55-df42da267172 --- # L-Value and R-Value Expressions @@ -31,7 +30,7 @@ The term "r-value" is sometimes used to describe the value of an expression and **Microsoft Specific** -Microsoft C includes an extension to the ANSI C standard that allows casts of l-values to be used as l-values, as long as the size of the object isn't lengthened through the cast. (For more information, see [Type-Cast Conversions](../c-language/type-cast-conversions.md).) The following example illustrates this feature: +Microsoft C includes an extension to the ANSI C standard that allows casts of l-values to be used as l-values, as long as the size of the object isn't lengthened through the cast. For more information, see [Type-Cast Conversions](../c-language/type-cast-conversions.md). The following example illustrates this feature: ``` char *p ; diff --git a/docs/c-language/parameters.md b/docs/c-language/parameters.md index cc504bb490..f2eb26888e 100644 --- a/docs/c-language/parameters.md +++ b/docs/c-language/parameters.md @@ -1,9 +1,8 @@ --- -description: "Learn more about: Parameters" title: "Parameters" -ms.date: "11/04/2016" +description: "Learn more about: Parameters" +ms.date: 11/04/2016 helpviewer_keywords: ["arguments [C++], function", "function parameters", "parameters [C++]", "function arguments, vs. parameters", "parameters [C++], function", "functions [C], parameters", "function parameters, syntax", "ellipsis (...), parameters", "... ellipsis"] -ms.assetid: 8f2b8026-78b5-4e21-86a3-bf0f91f05689 --- # Parameters @@ -50,7 +49,7 @@ void new( double x, double y, double z ) } ``` -If at least one parameter occurs in the parameter list, the list can end with a comma followed by three periods (**`, ...`**). This construction, called the "ellipsis notation," indicates a variable number of arguments to the function. (For more information, see [Calls with a Variable Number of Arguments](../c-language/calls-with-a-variable-number-of-arguments.md).) However, a call to the function must have at least as many arguments as there are parameters before the last comma. +If at least one parameter occurs in the parameter list, the list can end with a comma followed by three periods (**`, ...`**). This construction, called the "ellipsis notation," indicates a variable number of arguments to the function. For more information, see [Calls with a Variable Number of Arguments](../c-language/calls-with-a-variable-number-of-arguments.md). However, a call to the function must have at least as many arguments as there are parameters before the last comma. If no arguments are to be passed to the function, the list of parameters is replaced by the keyword **`void`**. This use of **`void`** is distinct from its use as a type specifier. diff --git a/docs/c-language/scope-and-visibility.md b/docs/c-language/scope-and-visibility.md index 72e07ffd0f..8f61550b6c 100644 --- a/docs/c-language/scope-and-visibility.md +++ b/docs/c-language/scope-and-visibility.md @@ -1,9 +1,8 @@ --- -description: "Learn more about: Scope and Visibility" title: "Scope and Visibility" -ms.date: "11/04/2016" +description: "Learn more about: Scope and Visibility" +ms.date: 11/04/2016 helpviewer_keywords: ["scope, levels", "visibility", "file scope [C++]"] -ms.assetid: a019eb7c-66ed-46a7-bc9f-89a963930a56 --- # Scope and Visibility @@ -15,7 +14,7 @@ All identifiers except labels have their scope determined by the level at which The declarator or type specifier for an identifier with file scope appears outside any block or list of parameters and is accessible from any place in the translation unit after its declaration. Identifier names with file scope are often called "global" or "external." The scope of a global identifier begins at the point of its definition or declaration and terminates at the end of the translation unit. **Function scope**\ -A label is the only kind of identifier that has function scope. A label is declared implicitly by its use in a statement. Label names must be unique within a function. (For more information about labels and label names, see [The goto and Labeled Statements](../c-language/goto-and-labeled-statements-c.md).) +A label is the only kind of identifier that has function scope. A label is declared implicitly by its use in a statement. Label names must be unique within a function. For more information about labels and label names, see [The goto and Labeled Statements](../c-language/goto-and-labeled-statements-c.md). **Block scope**\ The declarator or type specifier for an identifier with block scope appears inside a block or within the list of formal parameter declarations in a function definition. It is visible only from the point of its declaration or definition to the end of the block containing its declaration or definition. Its scope is limited to that block and to any blocks nested in that block and ends at the curly brace that closes the associated block. Such identifiers are sometimes called "local variables." diff --git a/docs/c-language/typedef-declarations.md b/docs/c-language/typedef-declarations.md index 019f17fbdf..b503212b6c 100644 --- a/docs/c-language/typedef-declarations.md +++ b/docs/c-language/typedef-declarations.md @@ -1,9 +1,8 @@ --- -description: "Learn more about: Typedef Declarations" title: "Typedef Declarations" -ms.date: "11/04/2016" +description: "Learn more about: Typedef Declarations" +ms.date: 11/04/2016 helpviewer_keywords: ["declarations, typedef", "typedef declarations", "types [C], declarations"] -ms.assetid: e92a3b82-9269-4bc6-834a-6f431ccac83e --- # Typedef Declarations @@ -43,7 +42,7 @@ A typedef declaration is interpreted in the same way as a variable or function d A typedef declaration doesn't create new types. It creates synonyms for existing types, or names for types that could be specified in other ways. When a typedef name is used as a type specifier, it can be combined with certain type specifiers, but not others. Acceptable modifiers include **`const`** and **`volatile`**. -Typedef names share the name space with ordinary identifiers. (For more information, see [Name Spaces](../c-language/name-spaces.md).) Therefore, a program can have a typedef name and a local-scope identifier by the same name. For example: +Typedef names share the name space with ordinary identifiers. For more information, see [Name Spaces](../c-language/name-spaces.md). Therefore, a program can have a typedef name and a local-scope identifier by the same name. For example: ```C typedef char FlagType; diff --git a/docs/c-runtime-library/code-pages.md b/docs/c-runtime-library/code-pages.md index f8700a2718..25a6e84f5d 100644 --- a/docs/c-runtime-library/code-pages.md +++ b/docs/c-runtime-library/code-pages.md @@ -1,10 +1,9 @@ --- title: "Code Pages" description: "A description of code page support in the Microsoft C runtime." +ms.date: 11/04/2016 ms.topic: "concept-article" -ms.date: "11/04/2016" helpviewer_keywords: ["character sets [C++], code pages", "ANSI [C++], code pages", "system-default code page", "multibyte code pages [C++]", "localization [C++], code pages", "code pages [C++], types of", "locale code pages [C++]"] -ms.assetid: 4a26fc42-185a-4add-98bf-a7b314ae6186 --- # Code pages @@ -22,7 +21,7 @@ The Microsoft runtime library uses the following types of code pages: also sets the locale to the system-default ANSI code page. -- Locale code page. The behavior of several run-time routines is dependent on the current locale setting, which includes the locale code page. (For more information, see [Locale](./locale.md).) By default, all locale-dependent routines in the Microsoft run-time library use the code page that corresponds to the "C" locale. At run time, you can change or query the locale code page in use with a call to [`setlocale`](./reference/setlocale-wsetlocale.md). +- Locale code page. The behavior of several run-time routines is dependent on the current locale setting, which includes the locale code page. For more information, see [Locale](./locale.md). By default, all locale-dependent routines in the Microsoft run-time library use the code page that corresponds to the "C" locale. At run time, you can change or query the locale code page in use with a call to [`setlocale`](./reference/setlocale-wsetlocale.md). - Multibyte code page. The behavior of most of the multibyte-character routines in the run-time library depends on the current multibyte code page setting. By default, these routines use the system-default ANSI code page. At run-time you can query and change the multibyte code page with [`_getmbcp`](./reference/getmbcp.md) and [`_setmbcp`](./reference/setmbcp.md), respectively. diff --git a/docs/c-runtime-library/reference/open-wopen.md b/docs/c-runtime-library/reference/open-wopen.md index 6b72d3b25f..13237079ca 100644 --- a/docs/c-runtime-library/reference/open-wopen.md +++ b/docs/c-runtime-library/reference/open-wopen.md @@ -1,6 +1,6 @@ --- -description: "Learn more about: _open, _wopen" title: "_open, _wopen" +description: "Learn more about: _open, _wopen" ms.date: 05/18/2022 api_name: ["_open", "_wopen"] api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-stdio-l1-1-0.dll"] @@ -8,7 +8,6 @@ api_type: ["DLLExport"] topic_type: ["apiref"] f1_keywords: ["CORECRT_IO/_open", "CORECRT_WIO/_wopen", "TCHAR/_topen", "_open", "_wopen", "_topen"] helpviewer_keywords: ["opening files, for file I/O", "topen function", "_open function", "_topen function", "_wopen function", "files [C++], opening", "wopen function", "open function"] -ms.assetid: 13f6a0c3-d1aa-450d-a7aa-74abc91b163e --- # `_open`, `_wopen` @@ -79,7 +78,7 @@ The **`_open`** function opens the file specified by *`filename`* and prepares i | `_O_RDONLY` | Opens a file for reading only. Can't be specified with `_O_RDWR` or `_O_WRONLY`. | | `_O_RDWR` | Opens a file for both reading and writing. Can't be specified with `_O_RDONLY` or `_O_WRONLY`. | | `_O_SEQUENTIAL` | Specifies that caching is optimized for, but not restricted to, sequential access from disk. | -| `_O_TEXT` | Opens a file in ANSI text (translated) mode. (For more information, see [Text and binary mode file I/O](../text-and-binary-mode-file-i-o.md) and [`fopen`](fopen-wfopen.md).) | +| `_O_TEXT` | Opens a file in ANSI text (translated) mode. For more information, see [Text and binary mode file I/O](../text-and-binary-mode-file-i-o.md) and [`fopen`](fopen-wfopen.md). | | `_O_TRUNC` | Opens a file and truncates it to zero length; the file must have write permission. Can't be specified with `_O_RDONLY`. `_O_TRUNC` used with `_O_CREAT` opens an existing file or creates a file. **Note:** The `_O_TRUNC` flag destroys the contents of the specified file. | | `_O_WRONLY` | Opens a file for writing only. Can't be specified with `_O_RDONLY` or `_O_RDWR`. | | `_O_U16TEXT` | Opens a file in Unicode UTF-16 mode. | @@ -96,7 +95,7 @@ If **`_open`** is called with **`_O_WRONLY | _O_APPEND`** (append mode) and `_O_ When two or more manifest constants are used to form the *`oflag`* argument, the constants are combined with the bitwise-OR operator ( **`|`** ). For a discussion of binary and text modes, see [Text and binary mode file I/O](../text-and-binary-mode-file-i-o.md). -The *`pmode`* argument is required only when `_O_CREAT` is specified. If the file already exists, *`pmode`* is ignored. Otherwise, *`pmode`* specifies the file permission settings, which are set when the new file is closed the first time. **`_open`** applies the current file-permission mask to *`pmode`* before the permissions are set. (For more information, see [`_umask`](umask.md).) *`pmode`* is an integer expression that contains one or both of the following manifest constants, which are defined in ``. +The *`pmode`* argument is required only when `_O_CREAT` is specified. If the file already exists, *`pmode`* is ignored. Otherwise, *`pmode`* specifies the file permission settings, which are set when the new file is closed the first time. **`_open`** applies the current file-permission mask to *`pmode`* before the permissions are set. For more information, see [`_umask`](umask.md). *`pmode`* is an integer expression that contains one or both of the following manifest constants, which are defined in ``. | *`pmode`* | Meaning | |--|--| diff --git a/docs/c-runtime-library/reference/sopen-s-wsopen-s.md b/docs/c-runtime-library/reference/sopen-s-wsopen-s.md index 04f2bd984a..9be97bd769 100644 --- a/docs/c-runtime-library/reference/sopen-s-wsopen-s.md +++ b/docs/c-runtime-library/reference/sopen-s-wsopen-s.md @@ -94,7 +94,7 @@ The integer expression *`oflag`* is formed by combining one or more manifest con | `_O_RDONLY` | Opens a file for reading only. Can't be specified with `_O_RDWR` or `_O_WRONLY`. | | `_O_RDWR` | Opens a file for both reading and writing. Can't be specified with `_O_RDONLY` or `_O_WRONLY`. | | `_O_SEQUENTIAL` | Specifies that caching is optimized for, but not restricted to, sequential access from disk. | -| `_O_TEXT` | Opens a file in ANSI text (translated) mode. (For more information, see [Text and binary mode file I/O](../text-and-binary-mode-file-i-o.md) and [`fopen`](fopen-wfopen.md).) | +| `_O_TEXT` | Opens a file in ANSI text (translated) mode. For more information, see [Text and binary mode file I/O](../text-and-binary-mode-file-i-o.md) and [`fopen`](fopen-wfopen.md). | | `_O_TRUNC` | Opens a file and truncates it to zero length; the file must have write permission. Can't be specified with `_O_RDONLY`. `_O_TRUNC` used with `_O_CREAT` opens an existing file or creates a file. **Note:** The `_O_TRUNC` flag destroys the contents of the specified file. | | `_O_WRONLY` | Opens a file for writing only. Can't be specified with `_O_RDONLY` or `_O_RDWR`. | | `_O_U16TEXT` | Opens a file in Unicode UTF-16 mode. | diff --git a/docs/c-runtime-library/reference/sopen-wsopen.md b/docs/c-runtime-library/reference/sopen-wsopen.md index c3e9b3a0aa..8d57455bb2 100644 --- a/docs/c-runtime-library/reference/sopen-wsopen.md +++ b/docs/c-runtime-library/reference/sopen-wsopen.md @@ -1,6 +1,6 @@ --- -description: "Learn more about: _sopen, _wsopen" title: "_sopen, _wsopen" +description: "Learn more about: _sopen, _wsopen" ms.date: 05/18/2022 api_name: ["_sopen", "_wsopen", "_o__sopen"] api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-stdio-l1-1-0.dll"] @@ -8,7 +8,6 @@ api_type: ["DLLExport"] topic_type: ["apiref"] f1_keywords: ["CORECRT_IO/_sopen", "CORECRT_WIO/_wsopen", "TCHAR/_tsopen", "_sopen", "_wsopen", "_tsopen", "sopen", "wsopen"] helpviewer_keywords: ["sopen function", "sharing files", "opening files, for sharing", "_sopen function", "wsopen function", "files [C++], opening", "files [C++], sharing", "_wsopen function"] -ms.assetid: a9d4cccf-06e9-414d-96fa-453fca88cc1f --- # `_sopen`, `_wsopen` @@ -88,7 +87,7 @@ The integer expression *`oflag`* is formed by combining one or more of the follo | `_O_RDONLY` | Opens a file for reading only. Can't be specified with `_O_RDWR` or `_O_WRONLY`. | | `_O_RDWR` | Opens a file for both reading and writing. Can't be specified with `_O_RDONLY` or `_O_WRONLY`. | | `_O_SEQUENTIAL` | Specifies that caching is optimized for, but not restricted to, sequential access from disk. | -| `_O_TEXT` | Opens a file in ANSI text (translated) mode. (For more information, see [Text and binary mode file I/O](../text-and-binary-mode-file-i-o.md) and [`fopen`](fopen-wfopen.md).) | +| `_O_TEXT` | Opens a file in ANSI text (translated) mode. For more information, see [Text and binary mode file I/O](../text-and-binary-mode-file-i-o.md) and [`fopen`](fopen-wfopen.md). | | `_O_TRUNC` | Opens a file and truncates it to zero length; the file must have write permission. Can't be specified with `_O_RDONLY`. `_O_TRUNC` used with `_O_CREAT` opens an existing file or creates a file. **Note:** The `_O_TRUNC` flag destroys the contents of the specified file. | | `_O_WRONLY` | Opens a file for writing only. Can't be specified with `_O_RDONLY` or `_O_RDWR`. | | `_O_U16TEXT` | Opens a file in Unicode UTF-16 mode. | diff --git a/docs/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l.md b/docs/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l.md index 9d253c5cf2..92cf4ff91e 100644 --- a/docs/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l.md +++ b/docs/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l.md @@ -1,14 +1,13 @@ --- -description: "Learn more about: strftime, wcsftime, _strftime_l, _wcsftime_l" title: "strftime, wcsftime, _strftime_l, _wcsftime_l" -ms.date: "4/2/2020" +description: "Learn more about: strftime, wcsftime, _strftime_l, _wcsftime_l" +ms.date: 4/2/2020 api_name: ["strftime", "_wcsftime_l", "_strftime_l", "wcsftime", "_o__strftime_l", "_o__wcsftime_l", "_o_strftime", "_o_wcsftime"] api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-time-l1-1-0.dll"] api_type: ["DLLExport"] topic_type: ["apiref"] f1_keywords: ["_tcsftime", "strftime", "wcsftime", "_strftime_l", "_wcsftime_l"] helpviewer_keywords: ["_strftime_l function", "strftime function", "tcsftime function", "_wcsftime_l function", "wcsftime function", "_tcsftime function", "time strings"] -ms.assetid: 6330ff20-4729-4c4a-82af-932915d893ea --- # `strftime`, `wcsftime`, `_strftime_l`, `_wcsftime_l` @@ -84,7 +83,7 @@ By default, this function's global state is scoped to the application. To change |---|---|---|---| | **`_tcsftime`** | **`strftime`** | **`strftime`** | **`wcsftime`** | -The *`format`* argument consists of one or more codes; as in **`printf`**, the formatting codes are preceded by a percent sign (**`%`**). Characters that don't begin with **`%`** are copied unchanged to *`strDest`*. The `LC_TIME` category of the current locale affects the output formatting of **`strftime`**. (For more information on `LC_TIME`, see [`setlocale`](setlocale-wsetlocale.md).) The **`strftime`** and **`wcsftime`** functions use the currently set locale. The **`_strftime_l`** and **`_wcsftime_l`** versions of these functions are identical except that they take the locale as a parameter and use that instead of the currently set locale. For more information, see [Locale](../locale.md). +The *`format`* argument consists of one or more codes; as in **`printf`**, the formatting codes are preceded by a percent sign (**`%`**). Characters that don't begin with **`%`** are copied unchanged to *`strDest`*. The `LC_TIME` category of the current locale affects the output formatting of **`strftime`**. For more information on `LC_TIME`, see [`setlocale`](setlocale-wsetlocale.md). The **`strftime`** and **`wcsftime`** functions use the currently set locale. The **`_strftime_l`** and **`_wcsftime_l`** versions of these functions are identical except that they take the locale as a parameter and use that instead of the currently set locale. For more information, see [Locale](../locale.md). The **`strftime`** functions support these formatting codes: diff --git a/docs/cpp/anonymous-class-types.md b/docs/cpp/anonymous-class-types.md index 591f849267..2e26ebc728 100644 --- a/docs/cpp/anonymous-class-types.md +++ b/docs/cpp/anonymous-class-types.md @@ -1,9 +1,8 @@ --- -description: "Learn more about: Anonymous Class Types" title: "Anonymous Class Types" -ms.date: "11/04/2016" +description: "Learn more about: Anonymous Class Types" +ms.date: 11/04/2016 helpviewer_keywords: ["class types [C++], anonymous", "anonymous class types"] -ms.assetid: 9ba667b2-8c2a-4c29-82a6-fa120b9233c8 --- # Anonymous Class Types @@ -42,7 +41,7 @@ In the preceding code, `iValue` can be accessed using the object member-selectio int i = ptv.iValue; ``` -Anonymous classes are subject to certain restrictions. (For more information about anonymous unions, see [Unions](../cpp/unions.md).) Anonymous classes: +Anonymous classes are subject to certain restrictions. For more information about anonymous unions, see [Unions](../cpp/unions.md). Anonymous classes: - Cannot have a constructor or destructor. diff --git a/docs/cpp/fundamental-types-cpp.md b/docs/cpp/fundamental-types-cpp.md index 457e01bac4..69c1c4ca01 100644 --- a/docs/cpp/fundamental-types-cpp.md +++ b/docs/cpp/fundamental-types-cpp.md @@ -1,10 +1,9 @@ --- +title: "Built-in types (C++)" description: "Learn more about: Built-in types (C++)" -title: "Built-in types (C++)" ms.date: 07/22/2020 f1_keywords: ["__int128_cpp", "__wchar_t_cpp", "char_cpp", "char8_t_cpp", "char16_t_cpp", "char32_t_cpp", "double_cpp", "float_cpp", "int_cpp", "long_cpp", "long_double_cpp", "short_cpp", "signed_cpp", "unsigned_cpp", "unsigned_int_cpp", "wchar_t_cpp"] helpviewer_keywords: ["specifiers [C++], type", "float keyword [C++]", "char keyword [C++]", "__wchar_t keyword [C++]", "signed types [C++], summary of data types", "Integer data type [C++], C++ data types", "arithmetic operations [C++], types", "int data type", "unsigned types [C++], summary of data types", "short data type [C++]", "double data type [C++], summary of types", "long long keyword [C++]", "long double keyword [C++]", "unsigned types [C++]", "signed types [C++]", "void keyword [C++]", "storage [C++], basic type", "integral types, C++", "wchar_t keyword [C++]", "floating-point numbers [C++], C++ data types", "long keyword [C++]", "type specifiers [C++]", "integral types", "long keyword [C++]", "storing types [C++]", "data types [C++], void"] -ms.assetid: 58b0106a-0406-4b74-a430-7cbd315c0f89 --- # Built-in types (C++) @@ -14,11 +13,11 @@ Built-in types (also called *fundamental types*) are specified by the C++ langua The [`void`](void-cpp.md) type describes an empty set of values. No variable of type **`void`** can be specified. The **`void`** type is used primarily to declare functions that return no values or to declare generic pointers to untyped or arbitrarily typed data. Any expression can be explicitly converted or cast to type **`void`**. However, such expressions are restricted to the following uses: -- An expression statement. (For more information, see [Expressions](expressions-cpp.md).) +- An expression statement. For more information, see [Expressions](expressions-cpp.md). -- The left operand of the comma operator. (For more information, see [Comma Operator](comma-operator.md).) +- The left operand of the comma operator. For more information, see [Comma Operator](comma-operator.md). -- The second or third operand of the conditional operator (`? :`). (For more information, see [Expressions with the Conditional Operator](conditional-operator-q.md).) +- The second or third operand of the conditional operator (`? :`). For more information, see [Expressions with the Conditional Operator](conditional-operator-q.md). ## std::nullptr_t diff --git a/docs/cpp/multiple-base-classes.md b/docs/cpp/multiple-base-classes.md index d792657cd2..2ed8923362 100644 --- a/docs/cpp/multiple-base-classes.md +++ b/docs/cpp/multiple-base-classes.md @@ -1,7 +1,7 @@ --- -description: "Learn more about: Multiple Base Classes" title: "Multiple Base Classes" -ms.date: "11/19/2018" +description: "Learn more about: Multiple Base Classes" +ms.date: 11/19/2018 helpviewer_keywords: ["base classes [C++], multiple", "derived classes [C++], multiple bases", "multiple inheritance, class declaration", "multiple base classes [C++]"] --- # Multiple Base Classes @@ -142,7 +142,7 @@ The compiler detects ambiguities by performing tests in this order: 1. If overloaded functions are unambiguous, they're resolved. -1. If access to the name violates member-access permission, an error message is generated. (For more information, see [Member-Access Control](../cpp/member-access-control-cpp.md).) +1. If access to the name violates member-access permission, an error message is generated. For more information, see [Member-Access Control](../cpp/member-access-control-cpp.md). When an expression produces an ambiguity through inheritance, you can manually resolve it by qualifying the name in question with its class name. To make the preceding example compile properly with no ambiguities, use code such as: diff --git a/docs/cpp/pointers-to-members.md b/docs/cpp/pointers-to-members.md index 17e5da3112..9512ed71b3 100644 --- a/docs/cpp/pointers-to-members.md +++ b/docs/cpp/pointers-to-members.md @@ -1,9 +1,8 @@ --- -description: "Learn more about: Pointers to Members" title: "Pointers to Members" -ms.date: "11/04/2016" +description: "Learn more about: Pointers to Members" +ms.date: 11/04/2016 helpviewer_keywords: ["declarations, pointers", "class members [C++], pointers to", "pointers, to members", "members [C++], pointers to", "pointers, declarations"] -ms.assetid: f42ddb79-9721-4e39-95b1-c56b55591f68 --- # Pointers to Members @@ -121,7 +120,7 @@ The address of a static member isn't a pointer to a member. It's a regular point Invoking a virtual function through a pointer-to-member function works as if the function had been called directly. The correct function is looked up in the v-table and invoked. -The key to virtual functions working, as always, is invoking them through a pointer to a base class. (For more information about virtual functions, see [Virtual Functions](../cpp/virtual-functions.md).) +The key to virtual functions working, as always, is invoking them through a pointer to a base class. For more information about virtual functions, see [Virtual Functions](../cpp/virtual-functions.md). The following code shows how to invoke a virtual function through a pointer-to-member function: diff --git a/docs/cpp/postfix-expressions.md b/docs/cpp/postfix-expressions.md index 9ed1835bcf..dbb3ab65dd 100644 --- a/docs/cpp/postfix-expressions.md +++ b/docs/cpp/postfix-expressions.md @@ -1,9 +1,8 @@ --- -description: "Learn more about: Postfix Expressions" title: "Postfix Expressions" -ms.date: "11/04/2016" +description: "Learn more about: Postfix Expressions" +ms.date: 11/04/2016 helpviewer_keywords: ["operators [C++], postfix", "postfix expressions", "expressions [C++], postfix"] -ms.assetid: 7ac62a57-06df-422f-b012-a75b37d7cb9b --- # Postfix Expressions @@ -72,7 +71,7 @@ When a function is called, the following tasks are performed: Func( Temp_i ); ``` - Note that the initialization is performed as if using the equal-sign syntax instead of the parentheses syntax. A copy of `i` is made prior to passing the value to the function. (For more information, see [Initializers](../cpp/initializers.md) and [Conversions](../cpp/user-defined-type-conversions-cpp.md)). + Note that the initialization is performed as if using the equal-sign syntax instead of the parentheses syntax. A copy of `i` is made prior to passing the value to the function. For more information, see [Initializers](../cpp/initializers.md) and [Conversions](../cpp/user-defined-type-conversions-cpp.md). Therefore, if the function prototype (declaration) calls for an argument of type **`long`**, and if the calling program supplies an actual argument of type **`int`**, the actual argument is promoted using a standard type conversion to type **`long`** (see [Standard Conversions](../cpp/standard-conversions.md)). diff --git a/docs/cpp/postfix-increment-and-decrement-operators-increment-and-decrement.md b/docs/cpp/postfix-increment-and-decrement-operators-increment-and-decrement.md index 4d06719b10..9113738138 100644 --- a/docs/cpp/postfix-increment-and-decrement-operators-increment-and-decrement.md +++ b/docs/cpp/postfix-increment-and-decrement-operators-increment-and-decrement.md @@ -16,7 +16,7 @@ postfix-expression -- ## Remarks -C++ provides prefix and postfix increment and decrement operators; this section describes only the postfix increment and decrement operators. (For more information, see [Prefix Increment and Decrement Operators](../cpp/prefix-increment-and-decrement-operators-increment-and-decrement.md).) The difference between the two is that in the postfix notation, the operator appears after *postfix-expression*, whereas in the prefix notation, the operator appears before *expression.* The following example shows a postfix-increment operator: +C++ provides prefix and postfix increment and decrement operators; this section describes only the postfix increment and decrement operators. For more information, see [Prefix Increment and Decrement Operators](../cpp/prefix-increment-and-decrement-operators-increment-and-decrement.md). The difference between the two is that in the postfix notation, the operator appears after *postfix-expression*, whereas in the prefix notation, the operator appears before *expression.* The following example shows a postfix-increment operator: ```cpp i++; diff --git a/docs/cpp/prefix-increment-and-decrement-operators-increment-and-decrement.md b/docs/cpp/prefix-increment-and-decrement-operators-increment-and-decrement.md index 238ae3dfb0..0ca9c55341 100644 --- a/docs/cpp/prefix-increment-and-decrement-operators-increment-and-decrement.md +++ b/docs/cpp/prefix-increment-and-decrement-operators-increment-and-decrement.md @@ -1,10 +1,9 @@ --- -description: "Learn more about: Prefix Increment and Decrement Operators: ++ and --" title: "Prefix Increment and Decrement Operators: ++ and --" -ms.date: "11/04/2016" +description: "Learn more about: Prefix Increment and Decrement Operators: ++ and --" +ms.date: 11/04/2016 f1_keywords: ["--", "++"] helpviewer_keywords: ["increment operators [C++], syntax", "++ operator [C++], prefix increment operators", "operators [C++], decrement", "-- operator [C++], prefix decrement operators [C++]", "operators [C++], increment", "decrement operators [C++], syntax", "decrement operators [C++]"] -ms.assetid: 45ea7fc7-f279-4be9-a216-1d9a0ef9eb7b --- # Prefix Increment and Decrement Operators: `++` and `--` @@ -23,7 +22,7 @@ The prefix decrement operator (**`--`**) is analogous to the prefix increment op **Visual Studio 2017 version 15.3 and later** (available in [`/std:c++17`](../build/reference/std-specify-language-standard-version.md) mode and later): The operand of an increment or decrement operator may not be of type **`bool`**. -Both the prefix and postfix increment and decrement operators affect their operands. The key difference between them is the order in which the increment or decrement takes place in the evaluation of an expression. (For more information, see [Postfix Increment and Decrement Operators](../cpp/postfix-increment-and-decrement-operators-increment-and-decrement.md).) In the prefix form, the increment or decrement takes place before the value is used in expression evaluation, so the value of the expression is different from the value of the operand. In the postfix form, the increment or decrement takes place after the value is used in expression evaluation, so the value of the expression is the same as the value of the operand. For example, the following program prints "`++i = 6`": +Both the prefix and postfix increment and decrement operators affect their operands. The key difference between them is the order in which the increment or decrement takes place in the evaluation of an expression. For more information, see [Postfix Increment and Decrement Operators](../cpp/postfix-increment-and-decrement-operators-increment-and-decrement.md). In the prefix form, the increment or decrement takes place before the value is used in expression evaluation, so the value of the expression is different from the value of the operand. In the postfix form, the increment or decrement takes place after the value is used in expression evaluation, so the value of the expression is the same as the value of the operand. For example, the following program prints "`++i = 6`": ```cpp // expre_Increment_and_Decrement_Operators.cpp diff --git a/docs/cpp/standard-conversions.md b/docs/cpp/standard-conversions.md index 083ac66a0f..aabdc570be 100644 --- a/docs/cpp/standard-conversions.md +++ b/docs/cpp/standard-conversions.md @@ -1,7 +1,7 @@ --- -description: "Learn more about: Standard conversions" title: "Standard conversions" -ms.date: "10/02/2019" +description: "Learn more about: Standard conversions" +ms.date: 10/02/2019 helpviewer_keywords: ["standard conversions, categories of", "L-values [C++]", "conversions, standard"] --- # Standard conversions @@ -203,7 +203,7 @@ The second case in which a pointer to a class can be converted to a pointer to a The result of such a conversion is a pointer to the *subobject*, the portion of the object that is completely described by the base class. -The following code defines two classes, `A` and `B`, where `B` is derived from `A`. (For more information on inheritance, see [Derived Classes](../cpp/inheritance-cpp.md).) It then defines `bObject`, an object of type `B`, and two pointers (`pA` and `pB`) that point to the object. +The following code defines two classes, `A` and `B`, where `B` is derived from `A`. For more information on inheritance, see [Derived Classes](../cpp/inheritance-cpp.md). It then defines `bObject`, an object of type `B`, and two pointers (`pA` and `pB`) that point to the object. ```cpp // C2039 expected @@ -278,7 +278,7 @@ A reference to a class can be converted to a reference to a base class in these - The specified base class is accessible. -- The conversion is unambiguous. (For more information about ambiguous base-class references, see [Multiple base classes](../cpp/multiple-base-classes.md).) +- The conversion is unambiguous. For more information about ambiguous base-class references, see [Multiple base classes](../cpp/multiple-base-classes.md). The result of the conversion is a pointer to the subobject that represents the base class. diff --git a/docs/cpp/virtual-functions.md b/docs/cpp/virtual-functions.md index 665db8ecdf..308dcd2575 100644 --- a/docs/cpp/virtual-functions.md +++ b/docs/cpp/virtual-functions.md @@ -1,10 +1,9 @@ --- -description: "Learn more about: Virtual Functions" title: "Virtual Functions" -ms.date: "09/10/2019" -helpviewer_keywords: ["functions [C++], virtual functions", "derived classes [C++], virtual functions", "virtual functions"] -ms.assetid: b3e1ed88-2a90-4af8-960a-16f47deb3452 +description: "Learn more about: Virtual Functions" +ms.date: 09/10/2019 adobe-target: true +helpviewer_keywords: ["functions [C++], virtual functions", "derived classes [C++], virtual functions", "virtual functions"] --- # Virtual Functions @@ -137,7 +136,7 @@ Because virtual functions are called only for objects of class types, you cannot The **`virtual`** keyword can be used when declaring overriding functions in a derived class, but it is unnecessary; overrides of virtual functions are always virtual. -Virtual functions in a base class must be defined unless they are declared using the *pure-specifier*. (For more information about pure virtual functions, see [Abstract Classes](../cpp/abstract-classes-cpp.md).) +Virtual functions in a base class must be defined unless they are declared using the *pure-specifier*. For more information about pure virtual functions, see [Abstract Classes](../cpp/abstract-classes-cpp.md). The virtual function-call mechanism can be suppressed by explicitly qualifying the function name using the scope-resolution operator (`::`). Consider the earlier example involving the `Account` class. To call `PrintBalance` in the base class, use code such as the following: diff --git a/docs/cppcx/wrl/weakref-class.md b/docs/cppcx/wrl/weakref-class.md index 227bdd1cf2..66191b5c26 100644 --- a/docs/cppcx/wrl/weakref-class.md +++ b/docs/cppcx/wrl/weakref-class.md @@ -1,6 +1,6 @@ --- -description: "Learn more about: WeakRef Class" title: "WeakRef Class" +description: "Learn more about: WeakRef Class" ms.date: 11/22/2021 ms.topic: "reference" f1_keywords: ["client/Microsoft::WRL::WeakRef", "client/Microsoft::WRL::WeakRef::~WeakRef", "client/Microsoft::WRL::WeakRef::As", "client/Microsoft::WRL::WeakRef::AsIID", "client/Microsoft::WRL::WeakRef::CopyTo", "client/Microsoft::WRL::WeakRef::operator&", "client/Microsoft::WRL::WeakRef::WeakRef"] @@ -193,7 +193,7 @@ When this operation completes, an object that represents parameter *`riid`*. - `S_OK` if this operation succeeds, but the current `WeakRef` object has already been released. Parameter *`ptr`* is set to **`nullptr`**. -- `S_OK` if this operation succeeds, but the current `WeakRef` object isn't derived from parameter *`riid`*. Parameter *`ptr`* is set to **`nullptr`**. (For more information, see Remarks.) +- `S_OK` if this operation succeeds, but the current `WeakRef` object isn't derived from parameter *`riid`*. Parameter *`ptr`* is set to **`nullptr`**. For more information, see Remarks. ### Remarks diff --git a/docs/dotnet/how-to-migrate-to-clr.md b/docs/dotnet/how-to-migrate-to-clr.md index f7b4922791..e05adbbaf9 100644 --- a/docs/dotnet/how-to-migrate-to-clr.md +++ b/docs/dotnet/how-to-migrate-to-clr.md @@ -1,15 +1,14 @@ --- -description: "Learn more about: How to: Migrate to /clr" title: "How to: Migrate to /clr" +description: "Learn more about: How to: Migrate to /clr" +ms.date: 09/18/2018 ms.custom: "get-started-article" -ms.date: "09/18/2018" -helpviewer_keywords: ["upgrading Visual C++ applications, /clr compiler option", "compiling native code [C++]", "interoperability [C++], /clr compiler option", "interop [C++], /clr compiler option", "migration [C++], /clr compiler option", "/clr compiler option [C++], porting to"] -ms.assetid: c9290b8b-436a-4510-8b56-eae51f4a9afc ms.topic: upgrade-and-migration-article +helpviewer_keywords: ["upgrading Visual C++ applications, /clr compiler option", "compiling native code [C++]", "interoperability [C++], /clr compiler option", "interop [C++], /clr compiler option", "migration [C++], /clr compiler option", "/clr compiler option [C++], porting to"] --- # How to: Migrate to `/clr` -This article discusses issues that arise when compiling native code with **`/clr`**. (For more information, see [/clr (Common Language Runtime Compilation)](../build/reference/clr-common-language-runtime-compilation.md).) **`/clr`** allows native C++ code to invoke and be invoked from .NET assemblies in addition to other native C++ code. For more information on the advantages of compiling with **`/clr`**, see [Mixed (Native and Managed) Assemblies](../dotnet/mixed-native-and-managed-assemblies.md) and [Native and .NET Interoperability](../dotnet/native-and-dotnet-interoperability.md). +This article discusses issues that arise when compiling native code with **`/clr`**. For more information, see [/clr (Common Language Runtime Compilation)](../build/reference/clr-common-language-runtime-compilation.md). **`/clr`** allows native C++ code to invoke and be invoked from .NET assemblies in addition to other native C++ code. For more information on the advantages of compiling with **`/clr`**, see [Mixed (Native and Managed) Assemblies](../dotnet/mixed-native-and-managed-assemblies.md) and [Native and .NET Interoperability](../dotnet/native-and-dotnet-interoperability.md). ## Known issues compiling library projects with `/clr` @@ -120,7 +119,7 @@ Native types are **`private`** by default. A **`private`** native type isn't vis ### Floating point and alignment issues -`__controlfp` isn't supported in the common language runtime. (For more information, see [`_control87`, `_controlfp`, `__control87_2`](../c-runtime-library/reference/control87-controlfp-control87-2.md).) The CLR also doesn't respect [`align`](../cpp/align-cpp.md). +`__controlfp` isn't supported in the common language runtime. For more information, see [`_control87`, `_controlfp`, `__control87_2`](../c-runtime-library/reference/control87-controlfp-control87-2.md). The CLR also doesn't respect [`align`](../cpp/align-cpp.md). ### COM initialization diff --git a/docs/mfc/exception-handling-in-mfc.md b/docs/mfc/exception-handling-in-mfc.md index 3d16c77f89..29b8e759bf 100644 --- a/docs/mfc/exception-handling-in-mfc.md +++ b/docs/mfc/exception-handling-in-mfc.md @@ -1,9 +1,8 @@ --- -description: "Learn more about: Exception Handling in MFC" title: "Exception Handling in MFC" -ms.date: "11/19/2019" +description: "Learn more about: Exception Handling in MFC" +ms.date: 11/19/2019 helpviewer_keywords: ["DAO [MFC], exceptions", "assertions [MFC], When to use exceptions", "exception handling [MFC], MFC", "resource allocation exception", "resources [MFC], allocating", "keywords [MFC], exception handling", "errors [MFC], detected by assertions", "ODBC exceptions [MFC]", "serialization [MFC], exceptions", "Automation [MFC], exceptions", "exception macros [MFC]", "predefined exceptions [MFC]", "C++ exception handling [MFC], enabling", "C++ exception handling [MFC], MFC applications", "requests for unsupported services [MFC]", "database exceptions [MFC]", "archive exceptions [MFC]", "MFC, exceptions", "C++ exception handling [MFC], types of", "macros [MFC], exception handling", "abnormal program execution [MFC]", "OLE exceptions [MFC], MFC exception handling", "error handling [MFC], exceptions and", "class libraries [MFC], exception support", "exceptions [MFC], MFC macros vs. C++ keywords", "memory [MFC], out-of-memory exceptions", "Windows [MFC], resource allocation exceptions", "macros [MFC], MFC exception macros", "function calls [MFC], results", "out-of-memory exceptions [MFC]"] -ms.assetid: 0926627d-2ba7-44a6-babe-d851a4a2517c --- # Exception Handling in MFC @@ -40,7 +39,7 @@ Three categories of outcomes can occur when a function is called during program - Erroneous execution - The caller makes some mistake in passing arguments to the function or calls the function in an inappropriate context. This situation causes an error, and it should be detected by an assertion during program development. (For more information on assertions, see [C/C++ Assertions](/visualstudio/debugger/c-cpp-assertions).) + The caller makes some mistake in passing arguments to the function or calls the function in an inappropriate context. This situation causes an error, and it should be detected by an assertion during program development. For more information on assertions, see [C/C++ Assertions](/visualstudio/debugger/c-cpp-assertions). - Abnormal execution diff --git a/docs/mfc/reference/cbasepane-class.md b/docs/mfc/reference/cbasepane-class.md index b535d8ccdd..de3b9ea594 100644 --- a/docs/mfc/reference/cbasepane-class.md +++ b/docs/mfc/reference/cbasepane-class.md @@ -565,8 +565,8 @@ The library adds several new styles for panes. The following table describes the |AFX_CBRS_RESIZE|The pane can be resized. **Important:** This style is not implemented.| |AFX_CBRS_CLOSE|The pane can be closed.| |AFX_CBRS_AUTO_ROLLUP|The pane can be rolled up when it floats.| -|AFX_CBRS_REGULAR_TABS|When one pane docks to another pane that has this style, a regular tabbed window is created. (For more information, see [CTabbedPane Class](../../mfc/reference/ctabbedpane-class.md).)| -|AFX_CBRS_OUTLOOK_TABS|When one pane docks to another pane that has this style, an Outlook-style tabbed window is created. (For more information, see [CMFCOutlookBar Class](../../mfc/reference/cmfcoutlookbar-class.md).)| +|AFX_CBRS_REGULAR_TABS|When one pane docks to another pane that has this style, a regular tabbed window is created. For more information, see [CTabbedPane Class](../../mfc/reference/ctabbedpane-class.md).| +|AFX_CBRS_OUTLOOK_TABS|When one pane docks to another pane that has this style, an Outlook-style tabbed window is created. For more information, see [CMFCOutlookBar Class](../../mfc/reference/cmfcoutlookbar-class.md).| To use the new styles, specify them in *dwControlBarStyle*. diff --git a/docs/mfc/reference/cfont-class.md b/docs/mfc/reference/cfont-class.md index 2b22401550..6a91e72bb9 100644 --- a/docs/mfc/reference/cfont-class.md +++ b/docs/mfc/reference/cfont-class.md @@ -141,7 +141,7 @@ Specifies the desired clipping precision. The clipping precision defines how to To use an embedded read-only font, an application must specify `CLIP_ENCAPSULATE`. -To achieve consistent rotation of device, TrueType, and vector fonts, an application can use the bitwise OR operator (`|`) to combine the `CLIP_LH_ANGLES` value with any of the other *`nClipPrecision`* values. If the `CLIP_LH_ANGLES` bit is set, the rotation for all fonts depends on whether the orientation of the coordinate system is left-handed or right-handed. (For more information about the orientation of coordinate systems, see the description of the *`nOrientation`* parameter.) If `CLIP_LH_ANGLES` is not set, device fonts always rotate counterclockwise, but the rotation of other fonts is dependent on the orientation of the coordinate system. +To achieve consistent rotation of device, TrueType, and vector fonts, an application can use the bitwise OR operator (`|`) to combine the `CLIP_LH_ANGLES` value with any of the other *`nClipPrecision`* values. If the `CLIP_LH_ANGLES` bit is set, the rotation for all fonts depends on whether the orientation of the coordinate system is left-handed or right-handed. For more information about the orientation of coordinate systems, see the description of the *`nOrientation`* parameter. If `CLIP_LH_ANGLES` is not set, device fonts always rotate counterclockwise, but the rotation of other fonts is dependent on the orientation of the coordinate system. *`nQuality`*
Specifies the font's output quality, which defines how carefully the GDI must attempt to match the logical-font attributes to those of an actual physical font. See the `lfQuality` member in the `LOGFONT` structure in the Windows SDK for a list of values.