fork(1) download
  1. #define MAX_PROGS 3
  2. #include <time.h>
  3. #include <stdbool.h>
  4.  
  5. typedef struct __attribute__((__packed__)){
  6. bool Run;
  7. bool Aktiv;
  8. bool Write;
  9. struct tm startTime;
  10. time_t runTime;
  11. char Valve;
  12. } runevent_s;
  13.  
  14. int main()
  15. {
  16. runevent_s dayrunevent[MAX_PROGS];
  17. time_t rawtime = time(NULL);
  18. struct tm picTime = *localtime (&rawtime);
  19.  
  20. for (int i=0; i < MAX_PROGS; i++) {
  21. dayrunevent[i].startTime = picTime; // picTime ist vom typ struct tm
  22. dayrunevent[i].startTime.tm_mday = 5;
  23. mktime(&dayrunevent[i].startTime);
  24. }
  25. }
Success #stdin #stdout 0s 2180KB
stdin
Standard input is empty
stdout
Standard output is empty