0
Whoa, guys, chill out?
Next, programming teacher passed a little project and I need to pass a string as parameter in C++. How do I? I’ve seen it on the Internet and none of it worked.
I tested it like this:
void text_to_morse(std::string *frase, int tamanho);
Thus:
void text_to_morse(string& frase, int tamanho);
Thus:
void text_to_morse(char frase[], int tamanho);
Thus:
void text_to_morse(const char* frase, int tamanho);
And so:
void text_to_morse(const std::string &frase, int tamanho);
How to do it anyway? The function will translate a phrase that the user typed into morse code and save to a file.
Any one that works for you. The problem isn’t knowing which one to use, it’s knowing what you need.
– Maniero