Lo que vos queres hacer es copiar el IP a otra cadena?? Aqui tenes una solucion rapida. Primero buscamos el primer numero:
Ahora copiamos desde i hasta donde corresponda:
Código C:
Ver originalj = 0;
while ( isdigit (P_PARSE
[i
]) || P_PARSE
[i
] == '.' || P_PARSE
[i
] == ':' ) { IP[j] = P_PARSE[i];
i++; j++ ;
}
IP[j] = '\0';
La funcion seria:
Código C:
Ver originali = 0;
while ( ! isdigit (P_PARSE
[i
])) i
++; j = 0;
while ( isdigit (P_PARSE
[i
]) || P_PARSE
[i
] == '.' || P_PARSE
[i
] == ':' ) { IP[j] = P_PARSE[i];
i++; j++ ;
}
IP[j] = '\0';
Saludos