[ create a new paste ] login | about

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

kamarakay2000 - C, pasted on Aug 12:
#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=5;



     first = create();
     current =first;

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

              first = create();
              current = first;
          }
          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
3
4
5
6
In function `main':
undefined reference to `create'
undefined reference to `create'
undefined reference to `fill_structure'
undefined reference to `create'
undefined reference to `fill_structure'


Create a new paste based on this one


Comments: