title: Using scanf with a while loop to input two separate strings
body: <p>I'm trying to make a program which reads in a name and number which is separated with a space and allocates the input to a structure. </p>
  
  <pre><code>typedef struct {
  
      char name [20];
      char number [12];
  } Entry;
  </code></pre>
  
  <p>The <code>scanf</code> function is in a while loop, and I'd like it to break from the while loop if the input is <code>"."</code></p>
  
  <pre><code>while(strcmp(e.name,".")!=0) {
      scanf("%s %s", e.name, e.number );
  }
  </code></pre>
  
  <p>But using the above code means that the user has to input two periods. I was wondering if anybody had any advice on how I could make it break from the loop after the first <code>"."</code>.</p>