9 years, 10 months ago.

What does putc return?

putc returns an integer. But howto interpret this value? And does SerialBase::_base_putc return the same?

Question relating to:

1 Answer

9 years, 10 months ago.

It returns an integer based on if the operation was successful or not.

Accepted Answer

Can you tell me which values indicate success and which ones an error?

posted by BlazeX . 13 Jan 2015

If they ported from form the cstdio standard library then if was a success it will return the ascii value of the char that was written else it will return the ascii value of the EOF char. I have found this site to be really helpful for most questions dealing with the mbed; http://www.cplusplus.com/reference/clibrary/. The second part of your question I would think they return the same because it looks like they are just using the namespace way of calling the function but I don't know for any surety.

posted by Jorden Luke 13 Jan 2015