Save data using a struct

0

I want to save the times of the athletes in minutes and seconds. For that, I made a time struct. But I have two problems:

  • I keep only the last data entered.
  • When I ask you to control that the user does not enter more than 59 minutes, or seconds, I skip the program. I put: if (time.minutes
  • asked by Adri 25.07.2018 в 16:32
    source

    1 answer

    2

    You are loading 1 single struct and you step on it 10 times, you should create an array of your struct and go one by one.

    struct time{
      int minutos;
      int segundos;
    };
    
    struct time tiempos[10];
    
    int main(){
    

    and then upload / consult them within the for

     scanf ("%d", &tiempos[i].minutos);
    
        
    answered by 25.07.2018 / 16:43
    source