Re: appending a clist row



/* Allocate a blank array of strings. */
text = (char **)malloc(clist_columns * sizeof(char *));
if(text != NULL)
{
        /* Set each pointer to point to an allocated empty string. */
        for(i = 0; i < clist_columns; i++)
                text[i] = strdup("");
}

just for my curiosity: why do you use strdup() instead of passing the
const char * "" ?

I got the impression that the array and or strings within would be
modified.

I don't know if they are so just to be on the safe side I made coppies.


--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
..__                         ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]