0
I was following this example, but it was done on Windows, so it was used <conio.h>
. When I try to run on Linux I get 2 errors: an *h=int(tempo);
, that I don’t understand why, and the other in the getch
. How can I replace them?
#include <stdio.h>
void horario(float tempo, int *h, int *m)
{
*h=int(tempo);
*m=(tempo-*h)*60;
}
int main ()
{
int hora,minuto;
char resp;
float t;
do
{
printf("Digite o horario na forma centesimal: ");
scanf("%f",&t);
horario(t,&hora,&minuto);
printf("Horario: %02d:02%d\n",hora,minuto);
printf("Quer calcular outro horario? (S/N):");
resp=getch();
} while (resp=='S');
getch();
return 0;
}
This is the Stackoverflow in Portuguese. Please use this language when asking questions, not English.
– mgibsonbr