Skip to content

Instantly share code, notes, and snippets.

@graifman
Created June 2, 2016 15:14
Show Gist options
  • Save graifman/9565813acca5373a0893849006b300c6 to your computer and use it in GitHub Desktop.
Save graifman/9565813acca5373a0893849006b300c6 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
struct aluno{
char nome[50];
int ra;
};
int main()
{
struct aluno a1[3];
int i;
struct aluno *p;
char lixo[2];
for(i=0;i<3;i++){
printf("Nome\n");
gets(a1[i].nome);
printf("ra\n");
scanf("%d",&a1[i].ra);
gets(lixo);
}
for(i=0;i<3;i++){
p=&a1[i];
p->nome;
printf("%s\n",p->nome);
p->ra;
printf("%d\n",p->ra);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment