fork download
  1. #include <iostream>
  2. #include <stdio.h>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. const char* _user = "FOO";
  8. const char* _password = "BAR";
  9. const char* _session = "ABCDEFGHIJ";
  10. int _expectedSeq = 123;
  11.  
  12. char login[38];
  13. sprintf(login,
  14. "L%-6s%-10s%10s%10d\xA",
  15. _user,
  16. _password,
  17. _session,
  18. _expectedSeq);
  19.  
  20. for (int i = 0; i < 38; i++) {
  21. printf(" %02x", login[i] & 0xff);
  22. }
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
 4c 46 4f 4f 20 20 20 42 41 52 20 20 20 20 20 20 20 41 42 43 44 45 46 47 48 49 4a 20 20 20 20 20 20 20 31 32 33 0a