Implementation-defined. The implementation may implement "std::string" in anyway it wants, so long as it abides by the rules stated in the C++ standard. Use "sizeof()" to query the size of class, or piece of storage.
"how does it allocate memory for this?"
The data members of "Customer::name" are pushed onto the program's stack. The memory allocated internally to "Customer::name" is allocated prior to "newCustomer"'s construction.
"i just need it to hold about 30 characters at the most and want to make sure it's not creating a huge memory space for it."