Compiler Error C3892
'var' : you cannot assign to a variable that is const
A const variable cannot be changed after it is declared and initialized.
The following sample generates C3892:
// C3892.cpp
// compile with: /clr
ref struct Y1 {
static const int staticConst = 9;
};
int main() {
Y1::staticConst = 0; // C3892
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for