Thks for your help... But to be more specific here´s one part of my code...
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <alloc.h>
#include <string.h>
typedef enum observations
{
Item1=1,Item2,Item3,Item4,Item5
}Observations;
typedef enum trans_type
{
CRG=1, DBT,TRF
}Trans_type;
typedef enum utente
{
Student=1, Functionary ,Professor
}Utente;
typedef struct data
{
int day, month, year;
}Data;
typedef struct card
{
int num_card;
char name[255];
Utente utente;
Data data;
float balance;
char morada[60];
struct card *next;
} Card;
typedef Card *PtrCrt;
typedef struct transaccions
{
int codigo;
char nome[60];
Data data;
Trans_tipo trans_tipo;
float montante,crg;
Observacoes observacoes;
char local_treinos[60];
char nome_treinador[60];
struct trans *next;
PtrCrt p_cartao;
} Trans;
typedef Trans *PtrTrans;
/*------------------------Functions------------------------*/
void Insert_Card (PtrCrt *lista);
void Change_Card (PtrCrt *lista);
void Remove_Card (PtrCrt *lista);
void View_Cards (PtrCrt *lista);
void Delet_Cards (PtrCrt *lista);
int View_if_Cards (PtrCrt *lista, int cod, int ver);
void Insert_Trans (PtrTrans *lista);
void Remove_Trans (PtrTrans *lista);
void View_Trans (PtrTrans *lista);
void Delet_Trans (PtrTrans *lista);
int View_if_Trans (PtrTrans *lista, int cod, int ver);
void Error (char *msg);
PtrCrt Adress_Card (PtrCrt *lista, int cod);
PtrTrans Adress_Trans (PtrTrans *lista, int cod);
void View_Cards_Assoc (PtrCrt *lista);
void View_Card_Trans (PtrTrans *lista);
void Menu_Cards (void);
void Menu_Transaccions (void);
void Menu_Listall (void);
I need to calculate the Balance of every card in all new transaccions and
how put this verification
in one function?!
It´s better create one more strcut for movements (transaccions) cards?
I´m confused...
Jeff Mullen said:
Please be more specific. What is the balance of a card? What do you
need to verify? How are you representing the aggregation of cards?
As an array? A singly-linked list? Many singly-linked lists?
P.S.
http://www.nls.net/mp/413/sea.ZIP
Self-expanding arrays. (This is the code your college professor
warned you about.)