title: c++ program printing out address instead of value
body: <p>I have a program that takes in information through a struct and puts it into a vector, and I'm trying to print that information out but instead get an address. The structure should hold the values correctly so I think it's either my pointers or the way I'm printing it out.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstring&gt;
  #include&lt;vector&gt;
  
  using namespace std;
  
  struct student
  {
    char* fName;
    char* lName;
    int id;
    float gpa;
  };
  
  void add(vector&lt;student*&gt;*);
  
  int main() 
  {
    vector &lt;student*&gt;* list = new vector&lt;student*&gt;();
  
  
      if (strcmp(cmd,&quot;ADD&quot;) == 0)
      {
        add(list);  
      }
      else if (strcmp(cmd,&quot;PRINT&quot;) == 0)
      {
        for(vector&lt;student*&gt;::iterator i = list-&gt;begin(); i != list-&gt;end(); i++)
        {
          cout &lt;&lt; *i;
        }
        cout &lt;&lt; &quot;print&quot; &lt;&lt; endl;
      }
  }
    void add(vector&lt;student*&gt;* paramlist)
    {
      student* s = new student();
      s-&gt;fName = new char[25];
      s-&gt;lName = new char[25];
  
      cout &lt;&lt; &quot;Enter first name&quot; &lt;&lt; endl;
      cin &gt;&gt; s-&gt;fName;
  
      cout &lt;&lt; &quot;Enter last name&quot; &lt;&lt; endl;
      cin &gt;&gt; s-&gt;lName;
  
      cout &lt;&lt; &quot;Enter id number&quot; &lt;&lt; endl;
      cin &gt;&gt; s-&gt;id;
  
      cout &lt;&lt; &quot;Enter GPA&quot; &lt;&lt; endl;
      cin &gt;&gt; s-&gt;gpa;
  
      paramlist-&gt;push_back(s);
    }
  </code></pre>
  <p>Or it might have something to do with the way I iterate through the vector.</p>