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.
12 years ago.
"ctype.h" is not part of mbed's C library?
Hello, I am trying to use int isascii (int c) to check if some of the characters arriving from a serial device are garbage chars to be ignored or ascii to be processed, however it seems that the ctype.h include doesn't work. Does anyone have any insights? Regards, Evgheni C
1 Answer
12 years ago.
Including ctype.h works fine for me. No specific knowledge of those functions, but according to the C++ reference (http://www.cplusplus.com/reference/cctype/) isascii is not a function there. Granted a google shows it is used often, but I dont know if it is part of the official standard.
That said, why do you need the function? Checking if something is an ascii char is straightforward: just check if it is smaller than 128. If you put it in a signed variable also check if it is larger than zero, but if it is just in a normal char that wont be needed.