Created
June 2, 2016 15:14
-
-
Save graifman/9565813acca5373a0893849006b300c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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