Ver Mensaje Individual
  #6 (permalink)  
Antiguo 15/02/2008, 10:46
athiria
 
Fecha de Ingreso: enero-2008
Mensajes: 22
Antigüedad: 16 años, 3 meses
Puntos: 0
Re: Pasar estructuras por referencia

Gracias Lucifer y Aloqui, al final he conseguido hacer el ejercicio y entender como funciona!

Saludos :D

Código:
#include <stdio.h>

	struct fecha
	{
		int day;
		int month;
		int year;
	};
	
void LeerFecha(struct fecha *Date)
{
	(*Date).day=1;
	(*Date).month=2;
	(*Date).year=3;
}

int main()
{
	
	struct fecha Date;
	
	LeerFecha(&Date);
	
	printf("%d\n",Date.day);
	printf("%d\n",Date.month);
	printf("%d\n",Date.year);
	
	
	return 0;	
}