Particle.subscribe giving error message

I am having some issues with a simple program. I am pretty new to Particle and C++ so assume you’re talking to someone with no idea what they’re doing.
int led = D6;

void yaddayadda(String event, String data) {
    if (Particle.subscribe("lit","on")) {
    } else if (Particle.subscribe("lit","off")) {

void setup() {
    Particle.subscribe("lit", yaddayadda);

void loop() {

The error message I received is:
"demonstrationled.ino:6:38: no matching function for call to ‘CloudClass::subscribe(const char [4], const char [3])’“
"demonstrationled.ino:8:46: no matching function for call to ‘CloudClass::subscribe(const char [4], const char [4])’”

I have been all over the forums and have no idea what’s going on. Please help!

Received events will be passed to a handler function similar to Particle.function(). A subscription handler (like myHandler above) must return void and take two arguments, both of which are C strings *(const char ).


Those most likely won’t do what you’re expecting of them either.

Being a beginner, why not give the docs, and known good examples a shot? Try those, and play around with them, adjusting them as you go?