I understand that a member initialzation list can be used to initialize objects and variables that have a known size.
However, how does a member initialization list actually work with pointers, in particular const char*
pointers, as in MyClass
below? Will it simply point to the memory location of the const char*
which I pass in?
class MyClass
{
public:
MyClass(const char* str): _str(str)
{
}
private:
const char* _str;
};