#include <stdio.h>
#include <math.h>
#include <iostream>
#include <stdlib.h> 
#include <string.h>
#include <malloc.h>
#include "fonctions.h"

point*saisirPoint()
{
	point *lePoint;
	 //
	//~(*.*~)
   //
 lePoint=(point*)(malloc(sizeof(point)));
	scanf("%c", &lePoint->nom);
	scanf("%lf", &lePoint->x);
	scanf("%lf", &lePoint->y);
 return lePoint;
}


point**saisirTableauPoints(int unNb)
{
	point** leTabPoints=(point**)malloc(sizeof(point)*unNb);
	int i;
	for(i=0;i<unNb-1;i++)
		leTabPoints[i] = (point*)malloc(sizeof(point));
	leTabPoints[unNb-1] = NULL;
	return leTabPoints;
}

char*toString(point**leTab)
{
	char* chainetab=(char*)malloc(sizeof(char));
	int i=0;
	do
	{
		strcat(chainetab, toStringaff(leTab[i]));
		i++;
	}while(leTab[i]!=NULL);
	return chainetab;
}
char * toStringaff(point* unP)
{
char* pBuffer;
pBuffer=(char*) malloc(sizeof(char)*40);
if (pBuffer==NULL) return NULL;
sprintf(pBuffer, "%c( %.2f, %.2f)", unP->nom,unP->x, unP->y);

// Restituer le resultat
//
return pBuffer;
}
