how to print a list<class*> ls?
<p>What am I doing wrong at the last two lines in my code below? I receive an error: </p>

<blockquote>
  <p>request for member <code>‘name’</code> in <code>‘t.std::_List_iterator&lt;_Tp&gt;::operator* [with _Tp = a*]()’</code>, which is of non-class type <code>‘a*’</code></p>
</blockquote>

<pre><code>#include &lt;dlfcn.h&gt;
#include &lt;iostream&gt;
#include "/home/developer/Desktop/MsgSphSDK1/test1_sdk/libsdk_MS.hpp"
#include &lt;list&gt;
#include &lt;typeinfo&gt;
#include &lt;string&gt;

using namespace std;

class a
{
public:
    string name;
    int age;
};

int main()
{
    a* l = new a();
    l-&gt;name = "me";
    l-&gt;age = 1;

    list&lt;a*&gt; ls;
    list&lt;a*&gt;::iterator t;

    for (t = ls.begin(); t != ls.end(); ++t) 
        cout &lt;&lt; (*t).name &lt;&lt; endl;
}
</code></pre>
