title: Getting User Input and storing into elements in Structure
body: <p>I am currently writing a simple code that repeatedly reads user input and store the input into a structure, subsequently printing them out. I encounter a problem while reading "accountNum" and "balance". The warning the compiler gave was due to the type of different arguments expected. (*int/*double vs int/double).
  I tried using gets() but to no avail. I am hoping to get an understanding on this.</p>
  
  <p>Also, am I accessing the elements correctly during the print function? Thanks in advance!</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  struct account {
      struct
      {
          char lastName[10];
          char firstName[10];
      } names;
      int accountNum;
      double balance;
      };
  
      void nextCustomer(struct account *acct);
      void printCustomer(struct account acct);
      int main()
      {
      struct account record;
      int flag = 0;
      do {
          nextCustomer(&amp;record);
          if ((strcmp(record.names.firstName, "End") == 0) &amp;&amp;
              (strcmp(record.names.lastName, "Customer") == 0))
              flag = 1;
          if (flag != 1)
              printCustomer(record);
          } while (flag != 1);
          }
  
          void nextCustomer(struct account *acct) {
          printf("Enter names: (firstName lastName): " );
          scanf("%s%s", acct-&gt;names.firstName, acct-&gt;names.lastName);
          printf("Enter account number: ");
          scanf("%d", acct-&gt;accountNum);
          printf("Enter balance : ");
          scanf("%lf", acct-&gt;balance);
          }
  
          void printCustomer(struct account acct) {
          printf("%s%s %d %lf", acct.names.firstName, acct.names.lastName ,acct.accountNum,acct.balance);
         }
  </code></pre>