about if available ethernet function

Hi everybody,

First excuse me for my English !

I work with the Ethernet libray

My question is about the available() function.

I can read ther :

http://arduino.cc/en/Reference/ClientAvailable

that this function "Returns the number of bytes available for reading (that is, the amount of data that has been written to the client by the server it is connected to). "

But when I read the example I can see : if (client.available()) { char c = client.read(); Serial.print(c); }

In this function I don't undestand the if condition : if (client.available())

It seems to be a boolean return and not a number

I could understand if the if condition were : if (client.available()>0)

because avalable returns a number, not a FALSE or TRUE

Please help me !

Thanks

Hi

So... 0 (zero) is false and everything else is true.

Saying "if (client.available())" is just short-handed for "if (client.available() > 0)" (assuming available() can't return negative value)

Ok, thanks !