SCR/AL1 - TOME III. Les librairies utilitaires
Syntax
unsigned char **SCR_vtom(str, sep)
unsigned char *str;
int sep;
Description
Vector to Matrix : crée un tableau de pointeurs à partir d'un string terminé par 0. Le séparateur de lignes est sep. La fonction alloue le tableau résultat ainsi que toutes les lignes à l'aide de SCR_malloc().
Le string input doit se terminer par un caractère nul. Le tableau résultat se termine par un pointeur nul.
La fonction inverse est SCR_mtov().
Valeur retournée
pointeur vers le tableau résultat alloué
Exemple
PrintList(string)
unsigned char *string;
{
int i;
unsigned char **tbl;
tbl = SCR_vtom(string, ',');
for(i = 0 ; tbl[i] ; i++)
printf("\"%s\"\n", tbl[i]);
SCR_free_tbl(tbl);
}
PrintList("Jean,Marc,Pierre");
donne :
"Jean"
"Marc"
"Pierre"
Voir également
SCR_vtoms() SCR_mtov(), SCR_free_tbl();
unsigned char **SCR_vtom(str, sep)
unsigned char **SCR_vtoms(str, seps)
unsigned char **SCR_vtoms2(str, seps, supdbl)
unsigned char **SCR_vtoms3(str, seps, supdbl)
Copyright © 1998-2015 Jean-Marc Paul and Bernard PAUL - Envoyez vos remarques ou commentaires à bernard@xon.be