string *words1 = new (nothrow) string[0];
You are allocating a dynamic array that can store 0 elements.
(That this doesn't make sense but is allowed anyway is a different discussion.)
You also forget to delete[] words1; at the end. This causes a memory leak.
You also forget to #include <string> at the beginning, and as a result your code is not portable. (Other people using a different compiler may get a compilation error.)
If you want to allocate a dynamic array of std::string that can store four of them: