fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void Payload(unsigned long lastTime, float deltaOne, float deltaTwo, int factor) {
  5. char buffer[sizeof(unsigned long) + sizeof(float) + sizeof(float) + sizeof(int) + 13];
  6. sprintf(buffer, "CAPTION,%u,%.4f,%.4f,%d,", lastTime, deltaOne, deltaTwo, factor);
  7. printf("%s", buffer);
  8. printf("\nCAPTION,11285600,50.2035,54.2035,5,\n");
  9. }
  10.  
  11. int main() {
  12. unsigned long record = 11285600UL;
  13. float delta1 = 50.2035;
  14. float delta2 = 54.2035;
  15. int factor = 5;
  16. Payload(record, delta1, delta2, factor);
  17. }
  18.  
  19. //http://pt.stackoverflow.com/q/184523/101
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
CAPTION,11285600,50.2035,54.2035,5,
CAPTION,11285600,50.2035,54.2035,5,