Révision 258
Ajouté par yoguer il y a presque 4 ans
branch/Guer/sp4a12/main.c | ||
---|---|---|
|
||
if(c>=48 && c<=57) //v?rifie que le caract?re est entre 0 et 9 compris
|
||
{
|
||
a=c-48; //donne la valeure en d?cimal du code ascii
|
||
a=c-48; //donne la valeur en d?cimal du code ascii
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
a=4;
|
||
break;
|
||
}
|
||
|
||
return a;
|
||
}
|
||
|
||
... | ... | |
|
||
if(tab[i]!= -1)
|
||
{
|
||
retour=retour*10+tab[i];
|
||
retour=(retour*10)+tab[i];
|
||
//printf("%d\n",);
|
||
}
|
||
}
|
||
printf("%d\n",retour);
|
||
return retour;
|
||
}
|
||
|
||
|
||
float conversion_char_latitude(char *latitude)
|
||
float conversion_sexa(char *latitude)
|
||
{
|
||
int tram=decode_nombre(latitude,12);
|
||
int tram=decode_nombre(latitude,15);
|
||
printf("%d\n",tram);
|
||
|
||
int degres=tram/10000000;
|
||
|
||
printf("%d\n\n",degres);
|
||
printf("%d\n",degres);;
|
||
}
|
||
|
||
|
||
... | ... | |
void test_conversion_latitude(void)
|
||
{
|
||
char *trame_latitude;
|
||
trame_latitude="3723.2475,N";
|
||
trame_latitude="136306.6036,E";
|
||
float retour;
|
||
|
||
conversion_char_latitude(trame_latitude);
|
||
conversion_sexa(trame_latitude);
|
||
//printf("%f",retour);
|
||
}
|
||
|
Formats disponibles : Unified diff
Modification fonction sexagésimal, TP1