title: How to get the current directory in a C program?
body: <p>I'm making a C program where I need to get the directory that the program is started from.  This program is written for UNIX computers. I've been looking at <code>opendir()</code> and <code>telldir()</code>, but <code>telldir()</code> returns a <code>off_t (long int)</code>, so it really doesn't help me. </p>
  
  <p>How can I get the current path in a string (char array)?</p>