PaulS:
char IPaddr[16]= {
'0','0','0','.','0','0','0','.','0','0','0','.','0','0','0' };
would involve a lot less typing as
char IPaddr[16] = "";
The second one results in a NULL terminated array of chars. There is no telling what is in elements 1, 2, 3, etc., but it doesn't matter because there is a NULL in 0. the reason i did this way is so that if a user presses E to the end without actually pressing numbers there will be a default already there
IPaddr[IPpos - 1] = key;
needs to be
IPaddr[IPpos - 1] = key;
IPaddr[IPpos] = '\0';to keep the string NULL terminated. the last 16th position has the null, if i try like this and you backspace with c and change the value the null moves and i need to keep null at the end When the 'E' key is pressed, you need to use the strtok() and atoi() functions to get the tokens (the parts between the dots) and convert them to numbers. i will try these functions in a few minutes