 <p>Aside from the non-C++-ness of your code, the exact problem is that <code>name</code> is a pointer to chars, and <code>""</code> is an array of chars. The code <code>name == ""</code> returns false, since name does not point to the first char in the array. Instead, you'll want to check if already allocated array is empty, by checking if the NULL terminator is the first character. <code>if (name[0] == '\0')</code> </p> <p>Now for the C++ ness: don't use <code>char*</code>, use <code>std::string</code>. Also, your code to keep prompting if you got invalid data is backwards.</p>