staafl

Untitled

Mar 14th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. using System;
  2.  
  3. // OR use BitConverter.IsLittleEndian
  4. class Program
  5. {
  6. unsafe static void Main() {
  7. int num = 1;
  8. bool le = *(byte*)&num == 1;
  9. Console.WriteLine("{0} endian", le ? "LITTLE" : "BIG");
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment