Mar 21, 2002 #1 swaroop Programmer Feb 4, 2001 100 US Some one Please help me. I need a program to Avoid duplication in charector array. Thanks in advance. Swaroop.
Some one Please help me. I need a program to Avoid duplication in charector array. Thanks in advance. Swaroop.
Mar 21, 2002 #2 Zyrenthian Programmer Mar 30, 2001 1,440 US I would think a sorted array would be the best bet, maybe with an insertion sort. Or maybe somethng like char current[128]; char lookFor[2]; memset(lookFor,0,2); lookFor[0]= character; if(!strstr(buffer,lookFor)) { insert it } <Matt Upvote 0 Downvote
I would think a sorted array would be the best bet, maybe with an insertion sort. Or maybe somethng like char current[128]; char lookFor[2]; memset(lookFor,0,2); lookFor[0]= character; if(!strstr(buffer,lookFor)) { insert it } <Matt
Mar 22, 2002 Thread starter #3 swaroop Programmer Feb 4, 2001 100 US Tankyou for your suggession. Upvote 0 Downvote
Apr 20, 2002 #4 jstreich Programmer Apr 20, 2002 1,067 US How about a binary search tree instead? The other way is to spend the time and do the compare on each item. Upvote 0 Downvote
How about a binary search tree instead? The other way is to spend the time and do the compare on each item.