Guest User

Untitled

a guest
Jan 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #pragma pack(1)
  2. struct MyStruct
  3. {
  4. int a;
  5. bool b;
  6. const char* c;
  7. };
  8.  
  9. void test(MyStruct* p)
  10. {
  11. MyStruct* s = p;
  12. s->a = 0x1234;
  13. s->b = true;
  14. s->c = "Hello world";
  15. }
  16.  
  17. int main()
  18. {
  19. MyStruct s;
  20. test(&s);
  21. return s.a;
  22. }
  23.  
  24. struct MyStruct
  25. {
  26. int a;
  27. bool b;
  28. const char* c;
  29. };
Add Comment
Please, Sign In to add comment