Export (0) Print
Expand All
Expand Minimize

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 {
public:
   void mf() { }
};

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

   pX.mf();
}

void main () { 
f();
} 

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft