how to snprintf to serial with String object type ?

Hello,

I would like to run the following simple code to simulate my problem:

typedef struct
{
String sensorName;
byte pin;
byte state;
}
sensorData;

// sensors on this node {sensorname,pinnr,begin_state}
sensorData sensorTable[6] =
{
{"POG04",1,0},
{"POG14",1,0},
{"ROG04",1,0},
{"ROG14",1,0},
{"LOG04",1,0},
{"TOG04",1,0}
};

void setup()
{ Serial.begin(57600);};
int debug =1;
// function to write data to Log
void writeLog(char* msg)
{
if (debug == 1) {Serial.println(msg);} //else sometimes no nextline is given
}

void loop()
{
char msgTmp(100);
for (int i = 0; i < 6 ; i++)
{
sensorTable*.sensorName ; *
_ Serial.println(sensorTable*.sensorName) ;_
_ if (sensorTable.sensorName.charAt(0) == 'T') // movement only for PIR sensors*
* {
snprintf(msgTmp,sizeof msgTmp, " sensorname= %s",sensorTable.sensorName);
writeLog(msgTmp);
}
}
delay(1000);
}
When I comment the snprintf, it works.
When I compile the code with the snprintf command not commented out,
I get the following error:_

_invalid conversion from 'char' to 'char'
sketch_sep18b:38: error: initializing argument 1 of 'int snprintf(char*, size_t, const char*, ...)'
Does anyone know how to SNPRINTF a STRING object ?
Thanks a lot,
Jeroen._

It should be

char msgTmp[100];

Note the brackets.

As for snprintf, since it's standardized, I don't think it can be made to understand the Arduino String class.
However, for converting a String to a char array, see toCharArray() - Arduino Reference
Why use String instead of const char* ?

Thanks dannym.

I've replaced the snprintf line code with the following (as you suggested):
char sensor[5];
sensorTable*.sensorName.toCharArray(sensor, 5);*
snprintf(msgTmp,sizeof msgTmp, " sensorname= %s",sensor);
And it worked like a charm.
And why I use the String class instead of char[]: for the easy use and standard includes functions.
Thanks a lot,
Jeroen