can you please explain this line of code in details “void dashboardPage(EthernetClient &client)” thanks
5 Answers
Can you just remind me where that code comes from? Which Course and Module/Unit? (Or post the link to my Github code)
Thanks!
it’s in Ethernet Web Server (Relay + Temperature) project inside Arduino Step-by-step Projects Course
Got it, thanks! Basically this is how you declare a function:
void dashboardPage(EthernetClient &client) { // your function }
- void – means that your function doesn’t return any value (it only performs a certain action)
- dashboardPage() – it’s the function name that you use too call it
- EthernetClient &client – you pass the client connection as a parameter
- // your function – where you place your code to run when you call that function (in this case it send the HTML page/dashboard to the connected client)
I hope that helps!
thanks a lot i only didnt get why you use & in this code what is the advantage of that operator &