[ create a new paste ] login | about

Link: http://codepad.org/90rALZJn    [ raw code | output | fork ]

kamarakay2000 - C, pasted on Aug 14:
#include <stdio.h>
#include <stdlib.h>

struct stats {
    int account;
    float balance;
    struct stats *next;
};
void fill_structure(struct stats *s);
struct stats *create(void);

int main()
{
    struct stats *first;
    struct stats *current;
    struct stats *new;
    int x;



    // first = create();
     current =first;

     for(x=0;x<5;x++)
     {
         if(x==0)
         {
         

              first = create();
              current = first;
          return(1);
          }
          else
          {
              new = create();
              current->next =new;
              current = new;
          }
          fill_structure(current);
      }
      current->next = NULL;
       
      current = first;
      while(current)
      {
           
           printf("Account %05:\t$%.2f\n",
                   current->account,
                   current->balance);
           current = current->next;
      }

      return(0);
}
 

       
              


Output:
1
2
In function `main':
undefined reference to `create'


Create a new paste based on this one


Comments: