In javascript you can pass to binary
i.e.
x = 2;
x.toString(2) //01
Tried this but it won’t except it.
How do I pass in an int and get the binary equivalent?
In javascript you can pass to binary
i.e.
x = 2;
x.toString(2) //01
Tried this but it won’t except it.
How do I pass in an int and get the binary equivalent?
var yourInt : int; //this is an int32, ie 4 bytes
var byteArray : Byte[] = new Byte[4];
byteArray = System.BitConverter.GetBytes(yourInt);
var x = 2;
var binaryString = System.Convert.ToString (x, 2);