Jump to content

[Resolvido] Estruturas


mateus8

Recommended Posts

Boas tenho um projecto para fazer e tou com uns problemas a introduzir um campo nas estruturas.

As estruturas em questão são:

typedef struct Turno
{
int num_turno;
char sala[15];
char docente[NUM_NOMES];
int capacidade;
int num_alunos_inscritos;
int hora;
int minuto;
int duracao;
char dia_sem[10];
}*TURNO;
typedef struct Disciplina
{
int codigo;
char nome;
int num_alunos;
TURNO pT;
TURNO pTP;
TURNO pPL;
struct Disciplina *seg;
}*DISCIPLINA;

typedef struct InsDisc
{
DISCIPLINA pt_dis;
struct InsDisc *seg;
}*INSDISC;

typedef struct InscTurno
{
int codigo;
int tipo;
int numero; //numero do turno
struct InscTurno *seg, *ant;
}*INSCTURNO;

typedef struct Aluno
{
int numero;
char nome[NUM_NOMES];
INSDISC ptDISC;
INSCTURNO ptTUR;
}*ALUNO;






typedef struct No
{
ALUNO inf;
struct No *esq, *dir;
}*NO;

typedef struct Arvore
{
int nelementos;
NO raiz;
}*ARVORE;









typedef struct Lista_Turno
{
TURNO inf;
struct Lista_Turno *seg;
}*LISTA_TURNO;


typedef struct Elemento
{
DISCIPLINA inf;
struct Elemento *seg;
}*ELEMENTO;

E a funçao que possovelmente esta mal para guardar a inscriçao numa disciplina é:

void ler_elemento(ELEMENTO E)
{
E=Criar_Elemento();
inicializar_elemento(E);
printf("\n Codigo da disciplina: ");
scanf("%d", E->inf->codigo);
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.