Printing a pointer to a pointer
<p>This may be very simple but I am confused! 
I am getting segmentation fault when extracting information from a pointer to a pointer. See the cout section in main(). Any help will be appreciated.<br>
Thanks..</p>

<p>Sen</p>

<pre><code>#include &lt;stdlib.h&gt;
#include &lt;iostream&gt;

typedef struct{
  int hour;
  int minute;
} Time;

Time* GetNextTime(void)
{
 Time *p_time = new Time;
 return p_time;  
}

void GetTime( Time **sometime )
{
 int length = 10;
 sometime = new Time*[length];
 for(int i=0; i&lt;length; i++)
 {
    sometime[i] = GetNextTime();
    sometime[i]-&gt;hour = rand()%24 ;
    sometime[i]-&gt;minute = rand()%60;
    std::cout &lt;&lt; "Entered times " &lt;&lt; sometime[i]-&gt;hour &lt;&lt; " hour " &lt;&lt; sometime[i]-&gt;minute &lt;&lt; " minutes " &lt;&lt; std::endl;
  }
}


int main()
{
  Time** _time;
  GetTime( _time );

 //here is the question
 // I cant print them from original _time
  for( int i=0; i&lt;10; i++)
  std::cout &lt;&lt;  " Print times " &lt;&lt; (*_time)[i].hour &lt;&lt; " hour " &lt;&lt; (*_time)[i].minute &lt;&lt; " minutes " &lt;&lt; std::endl;

}
</code></pre>
