Doing a search for printing a binary number in C# will get you results for functions and blocks of code that iterate through the bits. But that is completely unnecessary for this simple task.
The solution lies in the System.Converter class, which has 'toString' methods that take the base as the second argument.
Example:
PS> [convert]::ToString(0xfe, 2)
11111110
11111110
No comments:
Post a Comment