title: can't read string from file in c
body: <p>I'm trying to read a text file line by line and printing the first 17 characters. </p>
  
  <pre><code>FILE *devices;
  devices = NULL;
  devices = fopen("devices.txt", "r");
  
  char deviceaddr[17];
  char addr[17];
  
  char line[1024];
  
  while (fgets(line,1024,devices) != NULL)
  {
      fscanf(devices,"%s", deviceaddr);
  
      printf("%s\n", deviceaddr);
  }
  
  fclose(devices);
  </code></pre>
  
  <p>the output should be <code>00:07:80:4C:0E:EE</code>for the first line but it gives <code>6</code>.</p>