I wrote a code to input name in while loop and print the content of character pointer array. but after finishing the compile, I got the error message: "invalid null pointer!"
Since this is C++ you really should be using std::string instead of the C-strings, then you won't need to worry about memory allocation. And don't forget to insure that you never exceed the size of your name[] array in that loop.