I am using the isAlpha() command to check if my char variable is a number or letter but when I try to compile I get this error:
exit status 1
invalid conversion from 'char*' to 'int' [-fpermissive]
If I put an int inside isAlpha(), it compiles. What should I do?
Here is part of the code:
char val3c[val3.length() + 1];
val3.toCharArray(val3c, val1.length() + 1);
if (isAlpha(val3c)) {
c is case sensitive, should be all lower case..
https://en.cppreference.com/w/cpp/string/byte
good luck.. ~q
That still gives the same error. I used isAlpha because that's what it says on the arduino reference: isAlpha() - Arduino Reference
works on a char, not a char array..
check each char in the array..
~q
val3c is a character array.
isAlpha() can be used to determine if one element of that array is alphanumeric, like this:
if (isAlpha(val3c[0])) { //is the first character stored alphanumeric?
Thanks @qubits-us and @jremington. It works now.
1 Like