From 6d9cbb376a459342b0200e510ee5bb326b22db6d Mon Sep 17 00:00:00 2001 From: Rageking8 <106309953+Rageking8@users.noreply.github.com> Date: Mon, 4 Mar 2024 22:41:02 +0800 Subject: [PATCH] Update C2101 --- .../compiler-errors-1/compiler-error-c2101.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/error-messages/compiler-errors-1/compiler-error-c2101.md b/docs/error-messages/compiler-errors-1/compiler-error-c2101.md index 70d8b692fb2..a01fe6598c8 100644 --- a/docs/error-messages/compiler-errors-1/compiler-error-c2101.md +++ b/docs/error-messages/compiler-errors-1/compiler-error-c2101.md @@ -1,24 +1,22 @@ --- description: "Learn more about: Compiler Error C2101" title: "Compiler Error C2101" -ms.date: "11/04/2016" +ms.date: "03/04/2024" f1_keywords: ["C2101"] helpviewer_keywords: ["C2101"] -ms.assetid: 42f0136f-8cc1-4f2b-be1c-721ec9278e66 --- # Compiler Error C2101 '&' on constant -The address-of operator ( `&` ) must have an l-value as operand. +The [address-of operator (**`&`**)](../../cpp/address-of-operator-amp.md) must have an l-value as operand. The following sample generates C2101: ```cpp // C2101.cpp -int main() { - char test; - test = &'a'; // C2101 - test = 'a'; // OK +int main() +{ + int* ptr = &123; // C2101 } ```