Particle.function help

I am reading thru the help for using this but I find it confusing

the first statement is

int brewcoffee(String command);

it looks if be defining a variable “brewcoffee” as an integer array??

the second statement is

Particle.function(“brew”, brewcoffee);

I assume the function "brewcoffee is run when when brew is called from the cloud?

thanks steve

Nope that’s a function prototype (aka forward declaration) - a function that takes a String as parameter and returns an int as result.
Arrays are written like this in C/C++

int myArray[10];

That’s exactly the point.

1 Like