title: How to scan IP Address with fscanf
body: <p>how to scan IP Adress with scanf in c?</p>
  
  <p>I already user:</p>
  
  <p><code>scanf(" %d ", &amp;ip_adress)</code></p>
  
  <p>Should i use </p>
  
  <p><code>%d.%d.%d</code> </p>
  
  <p>or there is a easier way.</p>
  
  <p>This is my function for reading information from a file:</p>
  
  <pre><code>void read_tree_from(FILE *in, PC **root){
      char name[MAX_NAME];
      int ip_adress;
      int speed;
      while(fscanf(in, "%s %d %d", name, &amp;ip_adress, &amp;speed) != EOF){
          PC *new = create_new_item(name, ip_adress, speed);
          add_to_tree(new, root);
      }
  }
  </code></pre>
  
  <p>But when i run the program it works fine but in output file its mess...</p>