How can I remove a trailing comma from the end of the line, output from an array?
for ( k = numEntries - 1; k >= i; k--)
myArray[k] = myArray[k - 1];
myArray[i] = newValue;
for (i = 0; i < numEntries; i++) {
cout << myArray[i];
cout << ",";
}