title: atoi() not converting whole string because of special character
body: <p>I have data in my .txt file containing different time ins and time outs of employees. For example, <code>10:20</code> but I initially designed the structure to have their data types to be of char arrays or string. Since I'll be using the time values in another function, I have to use the atoi() function to convert them into integer values. Problem is, there is a colon <code>:</code> in each of the time values. Would it be possible to convert the string <code>10:20</code> to an integer using atoi() so that I can it in my future functions? Does the use of atoi() allow some splitting or some sort so that I can convert my time value from string to int?</p>
  <p>I tried</p>
  <pre><code>char time[10] = &quot;10:20&quot;;
  
  int val;
  
  printf(&quot;string val = %s, int value = %d&quot;, time, atoi(time));
  </code></pre>
  <p>But my output is only
  <code>string val = 10:20, int value = 10</code> so only the string before the <code>:</code> is read and converted to string. I would want that after converting, I would stil have 10:20 as the result but in integer because I am going to use relational operators with it.</p>