title: null in atoi converts the value to 0
body: <p>In my program, I have a char array (char data[]) from which i have to extract the data and store it in an integer variable(value). To do so, I have used atoi in my program. Problem is that I sometime receive null in the char array(data). If i use atoi on this value, I get the value  0 in integer variable instead of (null)</p>
  
  <p>The real function is quite big and I cannot post the entire code here. From function mentioned below, I hope you guys will get some idea about what I am doing here.</p>
  
  <pre><code>Get_Data(char data[])
  {
      int value;
      value = atoi(p);
  }
  </code></pre>
  
  <p>I recently read that we should use strtol instead of atoi. I tried that too. but I am still getting 0 in variable value. </p>
  
  <p>I want to know which function should i use so that i get (null) in integer variable value?</p>
  
  <p>By null, I mean empty character array here</p>
  
  <p>Please provide solutions specific to the problem. In the above function, if data gets empty char value, how do i make sure that my int variable value also gets empty value and not zero??</p>