cast from 'char*' to 'char' loses precision Bit of a noob here. Im trying to use the sensor number (float) in my mqtt topic, but cant seem to get this right. Any help would be appreciated. Keep getting this error (cast from 'char*' to 'char' loses precision)

      char buffer2[5];


       dtostrf(sensor.sensor_no, 4, 2, buffer2);
     char* buffer4 = mqtt_topic + char(buffer2);

  dtostrf(sensor.dht22_t,0, 0, buffer);
     client.publish(buffer4, buffer); //Topic name
By adding strings together you are actually adding together the addresses in memory where those strings are.

Instead you need to create a new empty buffer and fill it with the contents of the other strings.

char buffer4[32]; // &lt;-- Enough room for both strings and a NULL character

strcpy(buffer4, mqtt_topic);  // Copy in the first string
strcat(buffer4, buffer2); // concatenate the second string