title: How to get a value from optarg
body: <p>Hi I am writing a simple client-server program. In this program I have to use <code>getopt()</code> to get the port number and ip address like this:</p>
  
  <p>server -i 127.0.0.1 -p 10001</p>
  
  <p>I do not know how can I get values from optarg, to use later in the program.</p>