Equivalent of "unsafe" in VC++.NET

G

Guest

Hello
I'm looking for the VC++.NET equivalent of "unsafe" instruction.
unsafe is a VC#.NET instruction
Thanks
 
W

William DePalo [MVP VC++]

tlemcenvisit said:
I'm looking for the VC++.NET equivalent of "unsafe" instruction.
unsafe is a VC#.NET instruction

You may want to consider posting some more details as to what you want to
do. That said, a pragma will allow you to embed native code in a mostly
managed application

#pragma managed

// "unsafe" code goes here

#pragma unmanaged

Note that using The Managed Extensions for C++ (MC++) (soon to be C++/CLI)
is a specialty in its own right. You may want to consult a good text on the
topic or search MSDN for articles.

Regards,
Will
 
I

ismailp

well, there is no equivalent at all, in C++. C++ has a, somewhat,
better implementation of "unsafe".
code below "#pragma unmanaged" pragma in a translation unit becomes
unmanaged (unsafe??). you can write C or C++ code in those regions. to
revert it back to managed state, use #pragma managed. in that case,
code below this pragma will be compiled for CLI.

(William, managed and unmanaged pragmas better swap?)

Ismail
 
W

William DePalo [MVP VC++]

ismailp said:
(William, managed and unmanaged pragmas better swap?)

Yes, thank you. I should know not to post before my second cup of coffee in
the morning. :)

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top