Tuesday, 27 August 2013

bad compile constant value on dictinary string values

bad compile constant value on dictinary string values

i am trying to make a dictionary to convert from Binary to Hex, this is
what i made:
private Dictionary<string, char> binaryCharacterTohex = new
Dictionary<string, char>
{
{'0000', "0"},
{'0001', "1"},
{'0010', "2"},
{'0011', "3"},
{'0100', "4"},
{'0101', "5"},
{'0110', "6"},
{'0111', "7"},
{'1000', "8"},
{'1001', "9"},
{'1010', "a"},
{'1011', "b"},
{'1100', "c"},
{'1101', "d"},
{'1110', "e"},
{'1111', "f"}
};
but it keeps giving me "bad compile constant value" on every binary string
value i put there (the 'XXXX' ones), anyone can help me ?

No comments:

Post a Comment