how can i make the isxdigit() function by myself?
Look at the following to see how professionals define such function:
However, if you don't understand what they are doing, you just need to check if the digit is in this range:
(ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F')
If you let user enter lower case, then add:
|| (ch >= 'a' && ch <= 'f')
This was for one digit (one character). For a number, you need to do that check for every character.
I hope it is clear now.