Dynamic Vector + Dynamic Allocation [closed]

1

Good afternoon, I would like to know how to create a dynamic vector in C to store the following information:

Machine Status (On, Off, Broken) | state_time_status

to display on screen, as if it were a table. Ex: linked | 120.000000 sec      stop | 230.000000 sec

And then count everything to display the total states.

I do not even know where to start, and I want to try. Thank you.

    
asked by anonymous 09.12.2015 / 20:21

1 answer

1

If I understand what you want to do right, I suggest using struct .

It would look something like this:

struct meuVetorDinamico {
    char estado[20];
    float tempoEstado;
    float tempoTotal;
} algumAliasAqui;
    
09.12.2015 / 22:08