Hello, I have a program, where isdigit() function is used to check, if the character in char array is number. But in my program this function doesn't work properly. Here is my program.
if (isdigit(getRequest[5]) == 1)
{
room_num = getRequest[5] - '0';
Serial.print("room_num = ");
Serial.println(room_num, DEC);
Serial.print("getRequest[8] = ");
Serial.println(getRequest[8] - '0', DEC);
if (getRequest[7] == 't')
{
if (isdigit(getRequest[8] == 1)) //here it returns 0, but should return 1
{
Serial.println("getRequest[0] is DIGIT");
temp_num = getRequest[8] - '0';
Serial.print("temp_num = ");
Serial.println(temp_num, DEC);
}
}
Thank you for help.