fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct {
  5. char *teste_str;
  6. int teste_int;
  7. } TesteA;
  8.  
  9. typedef struct {
  10. TesteA *t;
  11. } TesteB;
  12.  
  13. int main(void) {
  14. TesteB teste;
  15. teste.t = malloc(3 * sizeof(TesteA));
  16. teste.t[0].teste_int = 25;
  17. printf("%d\n", teste.t[0].teste_int);
  18. }
  19.  
  20. //https://pt.stackoverflow.com/q/206288/101
Success #stdin #stdout 0s 4548KB
stdin
Standard input is empty
stdout
25