fork download
  1. #include <stdio.h>
  2.  
  3. struct connection
  4. {
  5. unsigned peer, local;
  6. };
  7.  
  8. struct info
  9. {
  10. int transferID;
  11. };
  12.  
  13. struct stats
  14. {
  15. struct connection connection;
  16. struct info info;
  17. };
  18.  
  19. int main(void)
  20. {
  21. char buff[100];
  22.  
  23. struct stats s = { { 1, 2 }, { 3 } };
  24. struct stats* stats = &s;
  25.  
  26. sprintf(buff,"Index:1:%u:%u:%d\n",
  27. stats->connection.peer,
  28. stats->connection.local,
  29. stats->info.transferID);
  30.  
  31. printf(" %s",buff);
  32. printf(" %d\n",stats->info.transferID);
  33.  
  34. return 0;
  35. }
  36.  
Success #stdin #stdout 0s 1788KB
stdin
Standard input is empty
stdout
  Index:1:1:2:3
  3