Top "Unsafe" questions

In C# or Rust, the unsafe keyword marks code able to work directly with memory pointers, bypassing some of the language's safety checks.

How do I get an owned value out of a `Box`?

What is the implementation for this function: fn unbox<T>(value: Box<T>) -> T { // ??? } …

rust unsafe
C# unsafe value type array to byte array conversions

I use an extension method to convert float arrays into byte arrays: public static unsafe byte[] ToByteArray(this float[] floatArray, …

c# arrays pointers type-conversion unsafe
error C4996: 'ctime': This function or variable may be unsafe

I have a large project about static source code analysis, and everything compiles successfully, except for one thing. I have …

c++ compiler-errors unsafe ctime
When to use pointers in C#/.NET?

I know C# gives the programmer the ability to access, use pointers in an unsafe context. But When is this …

c# .net performance pointers unsafe
How to use unsafe code Unity

I want to use c++ code in c# for unity using CLR. The program works properly outside of unity, but …

c# c++ unity3d clr unsafe
Should you use pointers (unsafe code) in C#?

Should you use pointers in your C# code? What are the benefits? Is it recommend by The Man (Microsoft)?

c# .net pointers coding-style unsafe
C# Unsafe/Fixed Code

Can someone give an example of a good time to actually use "unsafe" and "fixed" in C# code? I've played …

c# .net unsafe fixed
Which is faster - C# unsafe code or raw C++

I'm writing an image processing program to perform real time processing of video frames. It's in C# using the Emgu.…

c# c++ performance image-processing unsafe
golang: convert uint32 (or any built-in type) to []byte (to be written in a file)

I'm trying to convert an uint32 to a byte array (4 bytes) in Go using the unsafe library: h := (uint32)(((fh.…

arrays go byte unsafe
How to use unsafe code in safe contex?

I need to use SecureString for a Microsoft's class and i found the following code on the internet: public static …

c# extension-methods unsafe securestring