[ create a new paste ] login | about

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

kamarakay2000 - C, pasted on Aug 4:
#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;
       }
       else
       {
          new = create();
          current->next = new;
          current = new;
       }
       fill_structure(current);
 
   }
   current->next = NULL;

   current = first;
   while(current)
   {
        printf("Account %05d:\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: