Expermicid Posted November 11, 2012 Share Posted November 11, 2012 (edited) Hola a todos. Aqui les dejo esta funcion para esplitear un string xD [lenguaje=cpp]/* Funcion sSplitDirigido * Autor : Expermicid * Fecha : 11/11/12 * Modo de uso : sSplitDirigido(Texto,Delimitador,Index) */ const char* sSpliDirigido(char str[], char delimitador[], int elemento) { int paso = 0; char * pch = NULL; char * next_token = NULL; pch = strtok_s (str, delimitador, &next_token); while ((pch != NULL) && (paso < elemento)) { pch = strtok_s (NULL, delimitador, &next_token); paso += 1; } return pch; }[/lenguaje] Es como el que hice para delphi y java, se le pasa el String, el Delimitador y el Index del elemento que se quiere. This is the hidden content, please Sign In or Sign Up Saludos Edited February 16, 2014 by Expermicid Link to comment Share on other sites More sharing options...
Recommended Posts