title: Can somebody explain the return value of gets() in C?
body: <p>I am trying to find out the return value of function gets() in C, but i didn't understand it!</p>
  
  <p>I read in some books: Returns its argument if successful. A NULL pointer indicates an error or end-of-file condition.</p>
  
  <p>But the argument is a pointer to a char array. And as i understood right, the return value is also a char-pointer?</p>
  
  <p>For example:</p>
  
  <pre><code>int main(void)
  {
     char text[20];
     char *c = 0;
  
     printf("Please enter a text: ");
     gets(text);
     printf("Output: %s\n",text);
     printf("Return Value: %p\n",c);
  
     return 0;
  }
  </code></pre>
  
  <p>If i type in "hello world!" i got as output</p>
  
  <p>Output: hello world!
  Return Value: 00000000</p>
  
  <p>If i understand right, the return value shows a null pointer which means an error!?</p>
  
  <p>Please help!</p>