Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define MIN 50
- #define MAX 250
- #define qtd_alunos 2
- typedef struct {
- char _nomes[MIN][MAX];
- }_alunos;
- void imprimir(const char name[MIN][MAX])
- {
- int y;
- for(y=0; y <=qtd_alunos; y++){
- printf("%s \n",name[y]);
- }
- }
- void matricula()
- {
- int qtd=2,y;
- _alunos *a = (_alunos *) malloc(sizeof(_alunos));
- if (a == NULL)
- {
- printf("\n Ocorreu Algum Erro\n ");
- return;
- }else {
- for(y=0; y <= qtd_alunos; y++){
- printf("\n Digite os nomes: ");
- scanf("%s",a->_nomes[y]);
- }
- }
- }
- int main()
- {
- int opc;
- for(;;){
- printf("\n digite opc: ");
- scanf("%d",&opc);
- switch(opc){
- case 1:
- matricula();
- break;
- case 2:
- pesquisa();
- break;
- default:
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement