katjas
asked on
How to implement stringlist ???
Hi experts,
I want to implement a common stringlist.
My stringlist.h with my structire looks like:
typedef struct _stringlist {
char **strings;
size_t count;
} StringList;
Now i want to implement the following function:
StringList* stringlist_insert(StringLi st* list,
char* name)
My initializing function looks like:
StringList* stringlist_initialize()
{
StringList *stringlist = malloc(sizeof(StringList)) ;
if (stringlist == NULL)
return NULL;
stringlist->count = 0;
stringlist->strings = malloc(stringlist->sl_max*
sizeof(char *));
if (stringlist->strings == NULL)
return NULL;
return stringlist;
}
I have little problems with pointers, so can
anybody please help me , how to implement the
insert function ?????????????????????????? ?????
Many thanks
katjas
I want to implement a common stringlist.
My stringlist.h with my structire looks like:
typedef struct _stringlist {
char **strings;
size_t count;
} StringList;
Now i want to implement the following function:
StringList* stringlist_insert(StringLi
char* name)
My initializing function looks like:
StringList* stringlist_initialize()
{
StringList *stringlist = malloc(sizeof(StringList))
if (stringlist == NULL)
return NULL;
stringlist->count = 0;
stringlist->strings = malloc(stringlist->sl_max*
sizeof(char *));
if (stringlist->strings == NULL)
return NULL;
return stringlist;
}
I have little problems with pointers, so can
anybody please help me , how to implement the
insert function ??????????????????????????
Many thanks
katjas
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Wow .. it works !
Thank you
Thank you
if then, what does it for?
is it number of string or maximum char allow in one string?