title: initialize a pointer in a class with constructor
body: <p>I have an <code>Album</code> class in &quot;album.h&quot; like this:</p>
  <pre><code>#include &quot;song.h&quot;
  
  class Album
  {
  public:
  Album(string _id, string _title, string _singer, float _price, vector&lt;Song&gt; _songs) : id(_id), title(_title), singer(_singer), price(_price), songs(_songs), availableAlbums(10) {}
  void add_song(Song s){ songs.push_back(s); }
  void add_availableAlbums(int added){ availableAlbums += added; }
  string get_id(){ return id; }
  string get_singer(){return singer;}
  
  private:
  string id;
  string title;
  string singer;
  float price;
  vector &lt;Song&gt; songs;
  int availableAlbums;
  };
  </code></pre>
  <p>and a <code>Song</code> class in &quot;song.h&quot; like this:</p>
  <pre><code>#include &quot;album.h&quot;
  
  class Song
  {
  public:
  Song(string _numOfSong, string _title, string _singer, string _duration, float _price): 
  numOfSong(_numOfSong), title(_title), singer(_singer), duration(_duration), price(_price){}
  
  private:
  string numOfSong;
  string title;
  string singer;
  string duration;
  float price;
  Album* album;
  };
  </code></pre>
  <p>we know that every <code>Song</code> has an <code>Album</code> ( every <code>Song</code> must point to its <code>Album</code>) and i do that by initialize one <code>Album*</code> for every <code>Song</code> and i have some errors that are here:</p>
  <pre><code>error C2061: syntax error : identifier 'Album'
  error C2065: '_album' : undeclared identifier
  error C2143: syntax error : missing ';' before '*'
  error C2614: 'Song' : illegal member initialization: 'album' is not a base or member
  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  </code></pre>
  <p>thanks</p>