Compiler Error C3834
illegal explicit cast to a pinning pointer; use a pinned local variable instead
Explicit casts to a pinned pointer are not allowed.
Example
The following sample generates C3834.
// C3834.cpp
// compile with: /clr
int main() {
int x = 33;
pin_ptr<int> p = safe_cast<pin_ptr<int> >(&x); // C3834
pin_ptr<int> p2 = &x; // OK
}
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