I'm having a bit of trouble with something that should be pretty easy. I have list of words and I need to shift all members of the array up one place if there's a duplicate, so I'm using something that looks like:
1 2 3 4 5 6 7 8 9
if (wordArr[i].word == wordArr[i + 1].word)
{
//increasing word count by 1
wordArr[i].count += 1;
//shifting all words beyond the duplicate up by 1
for (int j = 0; j < totalWords - 1; j++)
wordArr[j] = wordArr[j + 1];
}
But it just returns a mess. Any help is greatly appreciated.