Sto provando a fare qualcosa del genere:

codice:
     string strelem;
     int const n = (sp[pos].identifier/10+1) + strlen(sp[pos].str)+4;
     strelem= (string)malloc(n+1 * sizeof(char));
     sprintf(strelem,"<%d,%s>",sp[pos].identifier,sp[pos].str);
considerando che string è così definito:

codice:
typedef char string[COST_NUM_CHAR];
Però mi da il seguente errore: "cast specifies array type" sulla riga che valorizza strelem.