cannot convert 'String' to 'char*' for argument '1' to 'int sprintf(char*, const

I dont know what is the problem with my code...

void newthings(String s)
{
String test ;
sprintf(test, "HELP: is very cold outside %s", s);
updatenewstatus(test);
}

i have this error:

cannot convert 'String' to 'char*' for argument '1' to 'int sprintf(char*, const char*, ...)'

The error message tells you everything you need to know.

If you want to stick with String, use "+" instead of sprintf

If you want to be sensible, ditch the String class, and use C strings.

I dont understand the c lang, can you write the corect code?

thank you

It's hard to know what "correct" means, because the code is incomplete - I don't for instance, know what "updatenewstatus" is.

void newthings(char* s)
{
  char buffer [80];
  sprintf(test, "HELP: it is very cold outside %s", s);  // A more defensive, less RAM-consuming approach may be needed here.

}

thank you

i correct the code...

  char buffer [80];
  sprintf(test, "HELP: it is very cold outside %s", s);

So, what is buffer for?

An exercise for the reader . . .