(a) Please use code tags
(b) First state the question, then, if necessary, post some code
(c) 'new' and delete[] don't mix. Either use 'new' and 'delete' or 'new[]' and 'delete[]'.
You are walking past the end of your cName array inside your first while loop.
Note the first element you access in the array is at index 1 (because of the ++count on the line immediately before) instead of 0, which means you are accessing one beyond the end of the array for the last element.