Hi I have morse codes of string separated by spaces for example *** --- *** for SOS .
Can anyone help me to read each morse code?
For the moment I am reading each character where I need to read each morse code so that I can pass morse code as a variable to other method where it returns alphabet character.
You could store the morse codes and their equivalent values in a map,
split the morse string on spaces, loop over these elements and retrieve the resulting values from your map (and concatenate them together) for your final result
this is an example showing the decoded SOS ‘… — …’
you can fill in the other morse codes, would’ve taken me too much time, sorry, used SOS since it’s so well known. 🙂
This example is also probably not very good nor optimised nor recommended, it’s been years since I came near c++. Hope it sparks some better idea in you though.