Morse Library problem

This could be the most obvious mistake ever. Ive only been doing this for 2 weeks and I feel like Ive bitten off more than I can chew with this code. Im using Maik Schmidts Arduino - a quick start quide. Ive got this .cpp file that is part of the morse generator and when i compile it keeps returning this message varianble or field ‘output_code’ declared void. Ive copied this exactly out of the book. this is the code as I have it:

Telegraph::Telegraph(const int output_pin, const int dit_length) {
_output_pin = output_pin;
_dit_length = dit_length;
_dah_length = dit_length * 3;
pinMode(_output_pin, OUTPUT);

void Telegraph::output_code(constant char* code) {
for (int i = 0 < strlen(code); i++) {
if (code == ‘.’)

  • dit();*
  • else*
  • dah();*
  • }*
    The line beginning void Telegraph:: is highlighted.
    Please help, I just want to make some stuff!
void Telegraph::output_code(constant char* code) {

The keyword is const, not constant.

There is some reason that the compiler does not like the fact that the output_code method's return type is void. Either the header file says it should be something different, or the use of the method expects something other than void.

From the snippets alone, we can not tell. That is why we encourage everyone to post all of their code.

Thanks Paul, That was a really stupid error. See I wasn't lying when i said i was a beginner. Next time I'll paste in all my code. I think I'll go back a few stages and play around a bit more so I have a deeper understanding of what's going on behind the scenes.