How to copy one string array to another excluding one string
I have a string array with the following data
AAA BBB CCC DDD
and I want to copy all the above data expect BB to another string array. I have the below. inputarray is my source string array and I want to write it to outputarr.
The problem I have is as seen below where data does not get copied consecutively to outputarr. Can some help me on this? Thanks.
int remBBB(char *inputarray, char *outputarr, int count)
printf ("In remBBB\n");
for (x=0; x < count; x++)
if (strcmp(inputarray[x],value) != 0)
memcpy(outputarr, inputarray, sizeof(outputarr));