fork download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3.  
  4. struct _blablabla_private {
  5. char *whatever1;
  6. size_t whatever2;
  7. size_t whatever3;
  8. size_t whatever4;
  9. char *whatever5;
  10. int *whatever6;
  11. };
  12.  
  13. struct blablabla {
  14. char data_[sizeof(struct _blablabla_private)];
  15. };
  16.  
  17. void lib_func_set(struct blablabla* bla) {
  18. struct _blablabla_private *priv = (struct _blablabla_private *)bla->data_;
  19. priv->whatever1 = "it works";
  20. }
  21.  
  22. void lib_func_get(const struct blablabla* bla) {
  23. struct _blablabla_private *priv = (struct _blablabla_private *)bla->data_;
  24. printf("%s\n", priv->whatever1);
  25. }
  26.  
  27. int main(void) {
  28. struct blablabla b;
  29.  
  30. lib_func_set(&b);
  31. lib_func_get(&b);
  32.  
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
it works