title: Printout st_uid in C Programming
body: <p>So I am making a very simple program that prints out the properties of a file on a UNIX system. </p>
  
  <p>I have been using stat() in order to do so. </p>
  
  <p>However, I am having a bit of trouble printing out the user and the group for the file. Everything else seems to be working okay.</p>
  
  <p>This is a small snippet of my code (already declared the struct):</p>
  
  <pre><code>stat(dir_pointer-&gt;d_name, &amp;buf);
  printf("%o %s\n", buf.st_nlink, buf.st_uid);
  </code></pre>
  
  <p>It gives me a segmentation fault every time I run this specific part of my code. Would the user and group be denoted as a string?</p>
  
  <p><strong>EDIT 1</strong>:</p>
  
  <pre><code>struct stat buf; // struct for stat
  </code></pre>