Expand Minimize
This topic has not yet been rated - Rate this topic

Compiler Error C3886

Error Message

'var' : a literal data member must be initialized

A literal variable must be initialized when it is declaraed.

The following sample generates C3886:

// C3886.cpp
// compile with: /clr /c
ref struct Y1 {
   literal int staticConst;   // C3886
   literal int staticConst2 = 0;   // OK
};
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.