Compiler Warning (level 1) C4831
Collapse the table of content
Expand the table of content

Compiler Warning (level 1) C4831 (Windows CE 5.0)

Windows CE 5.0
Send Feedback

'object' : you cannot declare a pointer to a 'managed' class or interface

Pointers are not permitted when creating objects from managed classes. Your code was compiled as if the * operator was not used, which means that a reference is created. However, it is still up to you to assign that reference to a valid object.

For example, the following managed code generates C4831:

class X {
   void mf() { }

void f() {
    X *pX;// C4831..use X pX;;

void main () { 

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.

© 2016 Microsoft