Problem with compilation ( text to morse with beep).

Deleted because some people copy my code.
Last edited on
> i have error like : binary 'operator' : no operator defined which takes a
> left-hand operand of type 'type' (or there is no acceptable conversion)
if you don't understand the message, then don't paraphrase it.

you wrote
1
2
Morse m;
m<<"Ala ma kota ";
forget a moment about operator overloading, you would have done m.output("Ala ma kotaa "); that means that you need a member function called `output()' that takes a string.

so you need to overload operator<< as a member function that takes a string.
and yet you did friend std::ostream & operator<<(std::ostream & os, const Morse & m2);
that is a non-member function that takes a strem and a Morse, and may be used as std::cout << m;

¿which one do you want?



To change to uppercase you may use toupper()
http://www.cplusplus.com/reference/cctype/toupper/
.
Last edited on
> visual say something about wrong missing type specifier
¿what part of «don't paraphrase» you don't understand?
paste the 212 lines of the error message if you need to, but don't withhold information (like line numbers)


> No i cant do function output
¿then why you do it in line 80?
Deleted on OP’s request.
Last edited on
Topic archived. No new replies allowed.