title: Structure Issue: initialization makes integer from pointer without a cast
body: <p>Here is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #define Length 20
  
      struct Capacitor
      {
          char Model[Length];
          int Capacitance;
          float Voltage;
          float Cost;
      };
  
  void displayCapacitorInfo(struct Capacitor List[])
  {
      int i;
      for (i = 0; i &lt; 4; i++)
      {
          printf("Capacitor %s:\n\n", List[i].Model);
          printf("   *Capacitance: %d uF\n", List[i].Capacitance);
          printf("   *Voltage: %f V\n", List[i].Voltage);
          printf("   *Cost: $%f\n", List[i].Cost);
          printf("\n");
      }
  }
  
  int main()
  {
      float Cost, Voltage;
      int Capacitance;
      char Model[Length];
  
      struct Capacitor a;
      struct Capacitor b;
      struct Capacitor c;
      struct Capacitor d;
  
      strcpy(a.Model, "11-123U");
      a.Capacitance = 100;
      a.Voltage = 25;
      a.Cost = 6.00;
  
      strcpy(b.Model, "65T91a");
      b.Capacitance = 22000;
      b.Voltage = 20;
      b.Cost = 25.00;
  
      printf("Model number of 1st capacitor: %s\n", a.Model);
      printf("Voltage of 2nd capacitor: %f V\n", b.Voltage);
  
      printf("\n");
  
      printf("Model number of 3rd capacitor:");
      scanf("%s", &amp;c.Model);
      printf("\n");
  
      printf("Capacitance of 3rd capacitor:");
      scanf("%d", &amp;c.Capacitance);
      printf("\n");
  
      printf("Voltage of 3rd capacitor:");
      scanf("%f", &amp;c.Voltage);
      printf("\n");
  
      printf("Cost of 3rd capacitor:");
      scanf("%f", &amp;c.Cost);
      printf("\n\n");
  
      printf("Model number of 4th capacitor:");
      scanf("%s", &amp;d.Model);
      printf("\n");
  
      printf("Capacitance of 4th capacitor:");
      scanf("%d", &amp;d.Capacitance);
      printf("\n");
  
      printf("Voltage of 4th capacitor:");
      scanf("%f", &amp;d.Voltage);
      printf("\n");
  
      printf("Cost of 4th capacitor:");
      scanf("%f", &amp;d.Cost);
      printf("\n\n");
  
      struct Capacitor List[] = { {a.Model, a.Capacitance, a.Voltage, a.Cost}, {b.Model, b.Capacitance, b.Voltage, b.Cost}, {c.Model, c.Capacitance, c.Voltage, c.Cost}, {d.Model, d.Capacitance, d.Voltage, d.Cost} };
  
      displayCapacitorInfo(List);
  
      return 0;
  
  }
  </code></pre>
  
  <p>Output:</p>
  
  <p><a href="http://i.stack.imgur.com/zN1ch.png" rel="nofollow">Warning</a></p>
  
  <p><a href="http://i.stack.imgur.com/FTceY.png" rel="nofollow">Result</a></p>
  
  <p>I am having trouble with my array List[], specifically when I try to input the model number of my capacitors. The Model element of structures a, b, c, and d produces a "initialization makes integer from pointer without a cast" warning when entered into the array List[].</p>
  
  <p>What can I do to fix this?</p>
  
  <p>Thanks for the help.</p>