SHARE
TWEET

Untitled

a guest Nov 9th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. typedef struct
  4. {
  5.     char value;
  6. } a;
  7.  
  8. typedef struct
  9. {
  10.     a **vvalue;
  11. } b;
  12.  
  13. int main(int argc, char const *argv[])
  14. {
  15.     b *t = malloc(sizeof(b));
  16.     t->vvalue = malloc(sizeof(a *) * 2);
  17.     t->vvalue[0] = malloc(sizeof(a));
  18.     t->vvalue[1] = malloc(sizeof(a));
  19.     t->vvalue[0]->value = 'a';
  20.     t->vvalue[1]->value = 'b';
  21.     printf("%s%c%c", "\n", t->vvalue[0]->value, t->vvalue[1]->value);
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top