I know one is a pointer, and the other is simply a class member of type /string/. I just need to figure out how the two differ in behavior. I've discovered places where I was able to declare pointers in classes, but not members of the type referred to by the pointer. I'm pretty sure it has to do with how the constructors of the member types behave, I'm just not sure what exactly is causing the problems. If I can't figure it out, I'll see if I can formulate a good example to demonstrate the problem.
As you say one is a pointer, and one is a class. The pointer holds an address in memory. It takes 4 bytes (probably, depending on architecture, etc.) and just holds a single number. End of story. The class member is a complete class instance held in memory, taking as much space as the class takes. Potentially that could be many bytes - or even many megabytes. They both work in the same way, only with the pointer you have to dereference it before you can utilise the class instance it points to. That is, you have to add the syntax which says "work with the object this pointer points to, not the pointer itself". Dereferencing is normally done with the -> operator for individual class members, or the * operator for the entire object. When creating a pointer, the compiler doesn't need to know the entire definition of the object. So you can say: class MyClass; class SomeOtherClass { ... private: MyClass* pointer; 'pointer' will just be 4 bytes and the compiler will note the class it's pointing to, but at this stage it doesn't need to know the details of MyClass - just being told there is a class called that is enough. When, elsewhere in the code, 'pointer' is dereferenced, the code at that point will need to know the full definition of MyClass. This might explain your "I can create a pointer but not an object" puzzle. If you want the object, you need to ensure the compiler can see the full definition of the class you're instantiating. You probably need to #include the appropriate header file. -- "...our desktop is falling behind stability-wise and feature wise to KDE ...when I went to Mexico in December to the facility where we launched gnome, they had all switched to KDE3." - Miguel de Icaza, March 2003