I am trying to write a simple text file translator, will translate the text into morsecode.

I need something like this to be done:

for(i = 0; i < list.size(); i++)
    if(list[i] == character_from_file)
        translatedLine = list[i_the_second];

I am wondering if I can use the "list" function in C++. But I dont know how to define a character then with a value?

Recommended Answers

All 2 Replies

I'm not fully sure if I get what you mean with your example, but I think you might be looking for a map? If not, please be more clear about what you mean with list[i] and list[i_the_second].

I was looking for the map thank you. And I was able to solv my problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.