C++ strings and pointers
This is because you have not allocate your objects prior to using them: It’s worth adding that using pointers in this situation is, well, pointless: string objects in the standard C++ library allocate the data for the string from the heap; strings are usually not much more than a pair of pointers anyway.