diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2081.md b/docs/error-messages/compiler-errors-1/compiler-error-c2081.md index 39c5c3f286..91f785dfd4 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2081.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2081.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C2081" title: "Compiler Error C2081" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2081" +ms.date: 11/04/2016 f1_keywords: ["C2081"] helpviewer_keywords: ["C2081"] -ms.assetid: 7db9892d-364d-4178-a49d-f8398ece09a0 --- # Compiler Error C2081 -'identifier' : name in formal parameter list illegal +> 'identifier' : name in formal parameter list illegal + +## Remarks The identifier caused a syntax error. This error can be caused by using the old style for the formal parameter list. You must specify the type of formal parameters in the formal parameter list. -The following sample generates C2081: +## Example + +The following example generates C2081: ```c // C2081.c diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2082.md b/docs/error-messages/compiler-errors-1/compiler-error-c2082.md index e5a420137b..205cdfdc0e 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2082.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2082.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2082" title: "Compiler Error C2082" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2082" +ms.date: 11/04/2016 f1_keywords: ["C2082"] helpviewer_keywords: ["C2082"] -ms.assetid: 87a6d442-157c-46e8-9bff-8388f8338ae0 --- # Compiler Error C2082 -redefinition of formal parameter 'identifier' +> redefinition of formal parameter 'identifier' + +## Remarks A formal parameter to a function is redeclared within the function body. To resolve the error, remove the redefinition. -The following sample generates C2082: +## Example + +The following example generates C2082: ```cpp // C2082.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2083.md b/docs/error-messages/compiler-errors-1/compiler-error-c2083.md index a3e24730c9..c47d0828db 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2083.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2083.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2083" title: "Compiler Error C2083" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2083" +ms.date: 11/04/2016 f1_keywords: ["C2083"] helpviewer_keywords: ["C2083"] -ms.assetid: 5fc4f931-eab6-4d8d-a3ee-3b8e11e64b18 --- # Compiler Error C2083 -struct/union comparison illegal +> struct/union comparison illegal + +## Remarks A structure or union is compared directly with another user-defined type. This is not allowed unless a comparison operator has been defined or a conversion to a scalar type exists. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2084.md b/docs/error-messages/compiler-errors-1/compiler-error-c2084.md index 19f1c11e73..8133c53ace 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2084.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2084.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C2084" title: "Compiler Error C2084" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2084" +ms.date: 11/04/2016 f1_keywords: ["C2084"] helpviewer_keywords: ["C2084"] -ms.assetid: 990b107f-3721-4851-ae8b-4b69a8c149ed --- # Compiler Error C2084 -function '*function*' already has a body +> function '*function*' already has a body + +## Remarks The function has already been defined. @@ -20,7 +21,7 @@ Before Visual Studio 2002, ## Example -The following sample generates C2084: +The following example generates C2084: ```cpp // C2084.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2085.md b/docs/error-messages/compiler-errors-1/compiler-error-c2085.md index fcd890fb8e..ab918561c4 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2085.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2085.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2085" title: "Compiler Error C2085" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2085" +ms.date: 11/04/2016 f1_keywords: ["C2085"] helpviewer_keywords: ["C2085"] -ms.assetid: 0a86785c-8e6f-481b-8c7b-412220c1950d --- # Compiler Error C2085 -'identifier' : not in formal parameter list +> 'identifier' : not in formal parameter list + +## Remarks The identifier was declared in a function definition but not in the formal parameter list. (ANSI C only) -The following sample generates C2085: +## Example + +The following example generates C2085: ```c // C2085.c diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2086.md b/docs/error-messages/compiler-errors-1/compiler-error-c2086.md index 25867e1a3e..a3cf0c60f0 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2086.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2086.md @@ -7,13 +7,17 @@ helpviewer_keywords: ["C2086"] --- # Compiler Error C2086 -'identifier' : redefinition +> 'identifier' : redefinition + +## Remarks The identifier is defined more than once, or a subsequent declaration differs from a previous one. C2086 can also be the result of incremental building for a referenced C# assembly. Rebuild the C# assembly to resolve this error. -The following sample generates C2086: +## Example + +The following example generates C2086: ```cpp // C2086.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2087.md b/docs/error-messages/compiler-errors-1/compiler-error-c2087.md index 990afe2050..bbda067722 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2087.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2087.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2087" title: "Compiler Error C2087" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2087" +ms.date: 11/04/2016 f1_keywords: ["C2087"] helpviewer_keywords: ["C2087"] -ms.assetid: 89761e83-415a-4468-a4c6-b6dedfd1dd6a --- # Compiler Error C2087 -'identifier' : missing subscript +> 'identifier' : missing subscript + +## Remarks The definition of an array with multiple subscripts is missing a subscript value for a dimension higher than one. -The following sample generates C2087: +## Example + +The following example generates C2087: ```cpp // C2087.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2088.md b/docs/error-messages/compiler-errors-1/compiler-error-c2088.md index d25127ed20..372c228b7e 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2088.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2088.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2088" title: "Compiler Error C2088" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2088" +ms.date: 11/04/2016 f1_keywords: ["C2088"] helpviewer_keywords: ["C2088"] -ms.assetid: b93f7094-185b-423d-8bb9-507cd757dbf5 --- # Compiler Error C2088 -'operator' : illegal for 'class-key' +> 'operator' : illegal for 'class-key' + +## Remarks The operator was not defined for the structure or union. This error is only valid for C code. -The following sample generates C2088 three times: +## Example + +The following example generates C2088 three times: ```c // C2088.c diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2089.md b/docs/error-messages/compiler-errors-1/compiler-error-c2089.md index 1bcf00bbc3..caf451167e 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2089.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2089.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2089" title: "Compiler Error C2089" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2089" +ms.date: 11/04/2016 f1_keywords: ["C2089"] helpviewer_keywords: ["C2089"] -ms.assetid: 7c777775-5535-4eea-b6a2-340b71af9560 --- # Compiler Error C2089 -'identifier' : 'class-key' too large +> 'identifier' : 'class-key' too large + +## Remarks The specified structure or union exceeds the 4GB limit. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2090.md b/docs/error-messages/compiler-errors-1/compiler-error-c2090.md index 715aaff8d3..384319cefd 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2090.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2090.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2090" title: "Compiler Error C2090" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2090" +ms.date: 11/04/2016 f1_keywords: ["C2090"] helpviewer_keywords: ["C2090"] -ms.assetid: e8176e55-382b-453d-aa27-6597f0274afd --- # Compiler Error C2090 -function returns array +> function returns array + +## Remarks A function cannot return an array. Return a pointer to an array instead. -The following sample generates C2090: +## Example + +The following example generates C2090: ```cpp // C2090.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2091.md b/docs/error-messages/compiler-errors-1/compiler-error-c2091.md index 9b354713a2..e873a8864e 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2091.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2091.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C2091" title: "Compiler Error C2091" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2091" +ms.date: 11/04/2016 f1_keywords: ["C2091"] helpviewer_keywords: ["C2091"] -ms.assetid: 247c3b57-f123-4420-b68e-d65a364b63cb --- # Compiler Error C2091 -function returns function +> function returns function + +## Remarks A function cannot return a function. Return a pointer to a function instead. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2092.md b/docs/error-messages/compiler-errors-1/compiler-error-c2092.md index ed654b5ab5..3b07baae29 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2092.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2092.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C2092" title: "Compiler Error C2092" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2092" +ms.date: 11/04/2016 f1_keywords: ["C2092"] helpviewer_keywords: ["C2092"] -ms.assetid: 037e44ae-16c8-489a-a512-dcdf7f7795a6 --- # Compiler Error C2092 -'array name' array element type cannot be function +> 'array name' array element type cannot be function + +## Remarks Arrays of functions are not allowed. Use an array of pointers to functions. -## Examples +## Example -The following sample generates C2092: +The following example generates C2092: ```cpp // C2092.cpp diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2093.md b/docs/error-messages/compiler-errors-1/compiler-error-c2093.md index 4cf2f9332a..ea575c3668 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2093.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2093.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C2093" title: "Compiler Error C2093" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2093" +ms.date: 11/04/2016 f1_keywords: ["C2093"] helpviewer_keywords: ["C2093"] -ms.assetid: 17529a70-9169-46b5-9fc6-57a5ce224e6a --- # Compiler Error C2093 -'variable1' : cannot be initialized using address of automatic variable 'variable2' +> 'variable1' : cannot be initialized using address of automatic variable 'variable2' + +## Remarks When compiling with [/Za](../../build/reference/za-ze-disable-language-extensions.md), the program tried to use the address of an automatic variable as an initializer. -The following sample generates C2093: +## Example + +The following example generates C2093: ```c // C2093.c diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2094.md b/docs/error-messages/compiler-errors-1/compiler-error-c2094.md index 2fd470d2dd..3c06cae2fe 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2094.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2094.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C2094" title: "Compiler Error C2094" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2094" +ms.date: 11/04/2016 f1_keywords: ["C2094"] helpviewer_keywords: ["C2094"] -ms.assetid: 9e4f8f88-f189-46e7-91c9-481bacc7af87 --- # Compiler Error C2094 -label 'identifier' was undefined +> label 'identifier' was undefined + +## Remarks The label used by a [goto](../../cpp/goto-statement-cpp.md) statement does not exist in the function. ## Example -The following sample generates C2094: +The following example generates C2094: ```cpp // C2094.c diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2095.md b/docs/error-messages/compiler-errors-1/compiler-error-c2095.md index 0c20af59dd..8a998415a2 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2095.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2095.md @@ -7,7 +7,9 @@ helpviewer_keywords: ["C2095"] --- # Compiler Error C2095 -'function' : actual parameter has type 'void' : parameter 'number' +> 'function' : actual parameter has type 'void' : parameter 'number' + +## Remarks The parameter passed to the function is type **`void`**, which is not allowed. Use a pointer to void (`void *`) instead. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2096.md b/docs/error-messages/compiler-errors-1/compiler-error-c2096.md index 429150aba6..9121807028 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2096.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2096.md @@ -1,6 +1,6 @@ --- -description: "Learn more about: Compiler Error C2096" title: "Compiler Error C2096" +description: "Learn more about: Compiler Error C2096" ms.date: 08/23/2022 f1_keywords: ["C2096"] helpviewer_keywords: ["C2096"] @@ -9,4 +9,6 @@ helpviewer_keywords: ["C2096"] > '*identifier*': A data member cannot be initialized with a parenthesized initializer +## Remarks + The compiler expected a braced initializer or an equal expression initializer. To resolve the issue, replace the parenthesized initializer with a braced initializer. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2097.md b/docs/error-messages/compiler-errors-1/compiler-error-c2097.md index b17f2535fb..0c01d1f89a 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2097.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2097.md @@ -1,14 +1,13 @@ --- -description: "Learn more about: Compiler Error C2097" title: "Compiler Error C2097" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2097" +ms.date: 11/04/2016 f1_keywords: ["C2097"] helpviewer_keywords: ["C2097"] -ms.assetid: 7e5b2fd4-f61c-4b8a-b265-93e987a04bd3 --- # Compiler Error C2097 -illegal initialization +> illegal initialization ### To fix by checking the following possible causes diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2098.md b/docs/error-messages/compiler-errors-1/compiler-error-c2098.md index b8c19fd652..886f3d8f80 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2098.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2098.md @@ -1,6 +1,6 @@ --- -description: "Learn more about: Compiler Error C2098" title: "Compiler Error C2098" +description: "Learn more about: Compiler Error C2098" ms.date: 08/23/2022 f1_keywords: ["C2098"] helpviewer_keywords: ["C2098"] @@ -9,4 +9,6 @@ helpviewer_keywords: ["C2098"] > unexpected token after data member '*identifier*' +## Remarks + The compiler expected a semicolon, a braced initializer or an equal expression initializer. To resolve the issue, insert a semicolon or an initializer. diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2099.md b/docs/error-messages/compiler-errors-1/compiler-error-c2099.md index 05dd905b4a..1547eff225 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2099.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2099.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C2099" title: "Compiler Error C2099" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C2099" +ms.date: 11/04/2016 f1_keywords: ["C2099"] helpviewer_keywords: ["C2099"] -ms.assetid: 30e151ee-d458-4901-b0c0-d45054a913f5 --- # Compiler Error C2099 -initializer is not a constant +> initializer is not a constant + +## Remarks This error is issued only by the C compiler and occurs only for non-automatic variables. The compiler initializes non-automatic variables at the start of the program and the values they are initialized with must be constant. ## Examples -The following sample generates C2099. +The following example generates C2099. ```c // C2099.c @@ -31,7 +32,7 @@ To resolve this error, compile the module as a .cpp file or simplify the express For more information, see [/fp (Specify Floating-Point Behavior)](../../build/reference/fp-specify-floating-point-behavior.md). -The following sample generates C2099. +The following example generates C2099. ```c // C2099_2.c diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2100.md b/docs/error-messages/compiler-errors-1/compiler-error-c2100.md index c2ec852188..e89c4bde43 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2100.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2100.md @@ -7,11 +7,15 @@ helpviewer_keywords: ["C2100"] --- # Compiler Error C2100 -illegal indirection +> illegal indirection + +## Remarks Indirection operator (`*`) is applied to a nonpointer value. -The following sample generates C2100: +## Example + +The following example generates C2100: ```cpp // C2100.cpp