My question is my code is working up until the while loop to do another message. It loops back with the same array again. I tried clearing the array but it just prints out an empty array. Is there a way to clear out the array and have the user input another message to fill the array again and print it again?
Why are you mixing C-stdio functions (scanf(), printf()) with C++ streams, that is just asking for trouble as is using C-strings instead of C++ streams.
Do you realize that the C++ extraction operator leaves a new line character in the buffer which your scanf() will take as it's only input?
You didn't answer my question about mixing C and C++ input methods. If you're writing a C++ stick with C++ streams, if you're writing a C program stick with C-stdio functions, don't mix the two.
I have to add getchar after the cin in order for it to work.
cin.get() would be a better option for a C++ program and getline() would be a better option for that scanf() call.