#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct aluno {
int matricula;
char nome[50];
char curso[20];
} Aluno;
Aluno *novo(int matricula, char *nome, char *curso) {
Aluno
*a
= malloc(sizeof(Aluno
)); a->matricula=matricula;
return a;
}
void libera(Aluno *aluno) {
}
void acessa(Aluno *aluno, int *matricula, char *nome, char *curso) {
*matricula = aluno->matricula;
}
void atribui(Aluno *aluno, int matricula, char *nome, char *curso) {
aluno->matricula = matricula;
}
int size() {
return (int)sizeof(Aluno);
}
int main() {
Aluno *a = novo(123, "victhor", "computacao");
int matricula;
char nome[50], curso[20];
acessa(a , &matricula, nome, curso);
printf("MatrĂcula: %d\n", matricula
); }
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgoKdHlwZWRlZiBzdHJ1Y3QgYWx1bm8gewogICAgaW50IG1hdHJpY3VsYTsKICAgIGNoYXIgbm9tZVs1MF07CiAgICBjaGFyIGN1cnNvWzIwXTsKfSBBbHVubzsKCkFsdW5vICpub3ZvKGludCBtYXRyaWN1bGEsIGNoYXIgKm5vbWUsIGNoYXIgKmN1cnNvKSB7CiAgICBBbHVubyAqYSA9IG1hbGxvYyhzaXplb2YoQWx1bm8pKTsKICAgIGEtPm1hdHJpY3VsYT1tYXRyaWN1bGE7CiAgICBzdHJjcHkoYS0+bm9tZSwgbm9tZSk7CiAgICBzdHJjcHkoYS0+Y3Vyc28sIGN1cnNvKTsKICAgIHJldHVybiBhOwp9Cgp2b2lkIGxpYmVyYShBbHVubyAqYWx1bm8pIHsKICAgIGZyZWUoYWx1bm8pOwp9Cgp2b2lkIGFjZXNzYShBbHVubyAqYWx1bm8sIGludCAqbWF0cmljdWxhLCBjaGFyICpub21lLCBjaGFyICpjdXJzbykgewogICAgKm1hdHJpY3VsYSA9IGFsdW5vLT5tYXRyaWN1bGE7CiAgICBzdHJjcHkobm9tZSwgYWx1bm8tPm5vbWUpOwogIC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