fork download
  1. #include <stdio.h>
  2.  
  3. typedef struct L1PE_STUB_compactContainerS
  4. {
  5. int runningNumber;
  6. } L1PE_STUB_compactContainerS;
  7.  
  8. typedef struct ULL1STUB_compactContainerRepoS
  9. {
  10. int runningNumber;
  11. int numSegRec;
  12. int maxNumSeg;
  13. L1PE_STUB_compactContainerS* cmCompactContainerArray[1];
  14. } ULL1STUB_compactContainerRepoS;
  15.  
  16.  
  17. int main(void) {
  18. int size = (sizeof(ULL1STUB_compactContainerRepoS)+2*sizeof(L1PE_STUB_compactContainerS*));
  19. int i = 0;
  20. unsigned char* byte_array;
  21. ULL1STUB_compactContainerRepoS* temp;
  22. printf("%i \n", size);
  23. temp = malloc(size);
  24. memset(temp, 1, size);
  25. printf("0x%x \n", temp);
  26. byte_array = temp;
  27.  
  28. while (i < size)
  29. {
  30. printf("%02X",(unsigned)byte_array[i]);
  31. i++;
  32. }
  33. i = 0;
  34. printf("\n-------------------\n");
  35. free((void*)temp);
  36. while (i < size)
  37. {
  38. printf("%02X",(unsigned)byte_array[i]);
  39. i++;
  40. }
  41. return 0;
  42. }
  43.  
Success #stdin #stdout 0s 10320KB
stdin
Standard input is empty
stdout
40 
0x98c01020 
01010101010101010101010101010101010101010101010101010101010101010101010101010101
-------------------
00000000000000000101010101010101010101010101010101010101010101010101010101010101