Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Int to 4 bytes
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int a = 59457; Console.WriteLine(BitConverter.GetBytes(a)[0]+" "+BitConverter.GetBytes(a)[1]+" "+BitConverter.GetBytes(a)[2]+" "+BitConverter.GetBytes(a)[3]); byte[] buffer = new byte[4]; buffer[0] = (byte) a; buffer[1] = (byte) (a >> 8); buffer[2] = (byte) (a >> 0x10); buffer[3] = (byte) (a >> 0x18); Console.WriteLine(buffer[0]+" "+buffer[1]+" "+buffer[2]+" "+buffer[3]); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
MIXED CONTENT - string and numbers separation in a large string
Lotto unieke getallen
saved
ProtectedUse
Operator Overloading Example (+, -, *, /, ==, !=)
hihi
ds
Hello world
Find Max Number Of Occurences in an int array
Tarkov Time
Please log in to post a comment.