Advanced C#
Q66 / 100

What is the purpose of the unsafe keyword in C#?

Correct! Well done.

Incorrect.

The correct answer is A) Enables code that bypasses type safety for direct memory access using pointers

A

Correct Answer

Enables code that bypasses type safety for direct memory access using pointers

Explanation

unsafe blocks allow pointer arithmetic (int* p = &x). Requires /unsafe compile flag. Used for interop, performance-critical code, and Span<T> internals.

Progress
66/100