using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { public struct Bin32 { private int m_Value; private Bin32(int value) { m_Value = value; } public static implicit operator Bin32(int value) { return new Bin32(value); } public override string ToString() { return Convert.ToString(m_Value, 2); } } class Program { static void Main(string[] args) { Bin32 binaryNumber = 15; } } }
binaryNumber
{1111}
15
ToString()
m_Value
Console.WriteLine(binaryNumber);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)