title: The variable optarg of the function getopt()
body: <p>I've read through the <a href="https://linux.die.net/man/3/optarg" rel="nofollow noreferrer">documentation for the function <code>getopt()</code></a>, but I do not find the explanations clear, especially with regards to the variable <code>optarg</code>. I cannot find any other sources that explicitly and clearly explain general information about <code>optarg</code>. My questions are as follows:</p>
  <ul>
  <li>What is <code>optarg</code>?</li>
  <li>How does <code>optarg</code> get its value?</li>
  <li>The documentation mentions something about colons changing the value of <code>optarg</code>; how does this work?</li>
  </ul>
  <p>The documentation has examples of how to use <code>optarg</code>, but I am more so interested in clear and elaborate explanations of the variable itself.</p>