-
-
Save zhangz/5b24015b0df418b1edbab1b3d522da04 to your computer and use it in GitHub Desktop.
Show memory address of array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unsafe private static void ShowAddress(string name, int[] item) | |
| { | |
| fixed (int* addr = item) | |
| { | |
| Console.Write($"\t0x{(ulong)addr:X}"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment