function call question

Hello.

This is a function call from GroveStreams:

sprintf(urlBuf, "PUT /api/feed?compTmplId=%s&compId=%s&compName=%s&api_key=%s%s HTTP/1.1",
** gsComponentTemplateId, myMac, gsComponentName, gsApiKey, getSamples());**

Is the %s replaced with the value stored in the following variable names (gsComponentTemplateId, myMac ... ) in the same order?

If this is the case why I can not write the variable directly: compTmplId=gsComponentTemplateId and so on ...?

Thanks Martin

Read the documentation for sprintf and it related functions.

Clue compTmplId is NOT a variable!

Mark

why I can not write the variable directly: compTmplId=gsComponentTemplateId and so on ...?

because you want to put the values of the variables in the array not the names of the variables.

Ok an string variable:

the declarations are:

char gsApiKey = "YOUR_SECRET_API_KEY_HERE"; //Change This!!!

char gsComponentName = "Temperature"; //Optionally change. Set this to give your component a name when it initially registers.

char gsDomain = "grovestreams.com"; //Don't change. The GroveStreams domain.

char gsComponentTemplateId = "temp"; //Don't change. Tells GS what template to use when the feed initially arrives and a new component needs to be created.