Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
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.
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 13 Jan 2015