Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- struct Datos{
- char nombre[30];
- char e_mail[30];
- int edad;
- };
- void Rellenar_datos (Datos amigo[]){///<---aqui error
- for(int i=0;i<3;i++){
- printf("Cual es tu nombre:\n");
- fflush(stdin);
- gets(amigo[i].nombre);
- printf("Cual es tu email:\n");
- fflush(stdin);
- gets(amigo[i].e_mail);
- printf("Cual es tu edad:\n");
- scanf("%d",&amigo[i].edad);
- }
- }
- void Imprimir_datos(Datos amigo[]){
- for(i=0;i<3;i++){
- printf("El nombre es:%s\n",amigo[i].nombre);
- printf("El email es:%s\n",amigo[i].e_mail);
- printf("La edad es:%d\n",amigo[i].edad);
- }
- }
- int main()
- {
- struct Datos amigo[3];///Declaramos un tipo de variable arreglo llamado amigo
- Rellenar_datos(amigo);
- Imprimir_datos(amigo);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment