title: How to get current time in C using gettime()?
body: <p>We're required to use <code>gettime()</code> to get the current time in C. I'm trying to print the current time but the error:</p>
  
  <blockquote>
    <p>error: storage size of 't' isn't known</p>
  </blockquote>
  
  <p>occurs. I don't know how to solve this. Here is the code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;dos.h&gt;
  
  int main(){
  
     struct time t;
  
     gettime(&amp;t);
  
     printf("%d:%d:%d", t.ti_hour,t.ti_min,t.ti_sec);
  
     getch();
     return 0;
  }
  </code></pre>