I want to split a string to Address and Port and return 1 if address starts with a number
bool isIPAddress(char** address, char** port)
*port = *address;
*port = strsep(port, ";");
return ((57 - **address) >= 10);
char a = "CONNECT:192.168.1.1:8000;";
//b = a;
char* c = a;
One too many deferences on address.
Seems strtok() would be more appropriate here. First call gives you "CHANNEL" second gives you the IP and the third gives you the port.
If you don't want to destroy your original string, then you can make a copy, and pass a reference for the port and the address and assign your result to the results of strtok() to them. Just off the top of my head.