Advertisement
Guest User

Untitled

a guest
Nov 9th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement