MQTT PubSubClient

No problem.

Also, in case it compiles but you don’t see the correct data being sent, you might actually want to send a string instead of the pure integer. You could do that with e.g.

client.publish(conTopic, "5", true);

note that there also C stdlib functions which convert from integer values to string values (when supplied a buffer), e.g. itoa or snprintf() and friends functions with e.g.

int valueToSend = 5;
char valueAsString[32] = {0};
snprintf(valueAsString, sizeof(valueAsString), "%d", valueToSend);
// send valueAsString as ASCII string as above