Thanx for the quick reply.
I have used a struct as follows :
struct ID {
int gid;
char *groupname;
} id;

now the parameter that is received is const char* gidlist

token=strtok((char *)gidlist,",");
while (token != NULL) {
tmp=atoi(token);
if (isdigit(tmp)) {
id.gid=tmp;
id.groupname=NULL;
printf("digit %d\n",id.gid);
}
else {
id.groupname=token;
printf("Nondigit char %s\n",id.groupname);

}

What is going wrong here, isdigit() doesn't seem to work..if I don't use atoi(), I get a segmentation fault error.