I'm programming a microcontroller in C and as part of it want to display certain letters on a 7 segment display. Each letter has a corresponding number that makes the 7 segment display show the letter. There's no real pattern to it cause the number is just made by adding up the bits on the 7 segment display that are needed to show the letter so it'd be really nice if I could create some sort of dictionary to do this.
If I was using C# or something I'd just make a dictionary and then add the letters as keys and the numbers as values but as far as I know I can't do this in C. Is there another way to do it or do should I just write a function like int displayletter(char letter)
that uses a bunch of if statements to return the right numbers?
Sorry if it's a stupid question, I'm quite new to C.