'MytdVersion' was not declared in this scope

The sketch below keeps reporting the above mentioned error.

#include <Arduino.h>
#include <Streaming.h>  /* http://arduiniana.org/libraries/streaming/ */
#include "String.h"
//#include "myUtils.h"

void setup() {
  Serial.begin(9600); // opens serial port, sets data rate to 115200 bps
  Serial << "Today's date " << (__DATE__) << endl;
  Serial.println(MytdVersion(__DATE__));
}

void loop() {
  // put your main code here, to run repeatedly:
}

void MytdVersion(*char str1)  {
  int num; // general purpose integer
  char doy;
  String tdVersion = str1;
  tdVersion.remove(0, 9);
//  Serial.println(tdVersion);
  num = 81;//DayOfYear(__DATE__);
  itoa(num, doy, 4);
//  Serial.println(num);
//  Serial.println(doy);
  if (num < 100) {
//    Serial.println("<100");

    tdVersion += "-";
    tdVersion += doy;
  } else {
    tdVersion += doy;
    }
  Serial.println(tdVersion);
  return tdVersion;
}

Did I mis sommething or ?? Thanx for anny suggestions / help
Harry

Your function is declared void but tries to return something.

wildbill:
Your function is declared void but tries to return something.

OK stupid question, I get a stupid answer.
But even when changing the function to a int I get the same error.
changed function:

int MytdVersion(*char str1)  {
  int num; // general purpose integer
  char doy;
  String tdVersion = str1;
  tdVersion.remove(0, 9);

  num = 81;//DayOfYear(__DATE__);
  itoa(num, doy, 4);
  if (num < 100) {
    tdVersion += "-";
    tdVersion += doy;
  } else {
    tdVersion += doy;
    }
  Serial.println(tdVersion);
  return num;
}

so again the question, whats wrong???

gharryh:

int MytdVersion(*char str1)

should that not be this instead?

int MytdVersion(char *str1) //asterisk moved

hope that helps....

The compiler gives me a bunch of warning and error messages (in the red text below the sketch). Some of those are preventing the function from being successfully defined.

your never to old to learn something

sp. "You're".

Learn to post the error messages
All of them

OK stupid question, I get a stupid answer

Stupid question, entirely sensible answer.

You're welcome

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.