Export (0) Print
Expand All
Expand Minimize

Compiler Error C3192

syntax error : '^' is not a prefix operator (did you mean '*'?)

A handle cannot be used as a dereference operator.

The following sample generates C3192:

// C3192.cpp
// compile with: /clr
using namespace System;

ref class MyClass {
public:
   MyClass () {}
   MyClass(MyClass%) {}
};

int main() {
   MyClass ^ s = gcnew MyClass; 
   MyClass b = ^s;   // C3192

   // OK
   MyClass b2 = *s;
}
Show:
© 2014 Microsoft