All pastes #274221 Raw Edit

Mine

public text v1 · immutable
·published 2006-12-10 15:21 UTC
rendered paste body
int leer_contorno_fichero (tContorno *dibujo, tNombre nombre_fichero)
{
	
	int i;
	FILE *fp;

	fp=fopen (nombre_fichero,"r");

	i=0;

	while (!feof(fp))
	{
		leer_coordenada_fichero(fp, &dibujo->contorno[i]);
		i++;
	}

	return i+1;


	fclose (fp);
}

int leer_coordenada_fichero(FILE *fp, tCoordenada *coordenada)
{
	
	if (fp==NULL)
	{
		printf ("Error al abrir el fichero");
		return 0;
	}

	else
	{
		fscanf (fp,"(%f,%f)", &coordenada->longitud,&coordenada->latitud);
		return 1;

	}

}