Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- parse ( tmp, (char*) delimiter, arr, &fldcnt ); /* whack record into fields */
- int index;
- char * row = malloc ( strlen(tmp) );
- char * line = malloc ( (size_t) MAXFLDSIZE );
- for ( i=0; i < afldcnt; i++ )
- {
- index = atoi(afields[i]);
- char * value = trim ( arr[index] );
- if ( i < afldcnt -1 )
- {
- snprintf ( line, sizeof ( line ) *2, "%s%s", value, delimiter );
- }
- else
- {
- snprintf ( line, sizeof ( line ) *2, "%s", value );
- }
- strcat ( row, line );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement