ok5.c 323 B

123456789101112131415161718
  1. struct Test {
  2. int a;
  3. char st[10];
  4. };
  5. int main() {
  6. printf("Hello world!\n");
  7. struct Test* ar = (struct Test*)malloc(10*sizeof(struct Test));
  8. ar[9].a=10;
  9. printf("Let's correctly delete an array of 10 objects\n");
  10. free(ar);
  11. printf("Done\n");
  12. printf("There should be 0 error in this run\n");
  13. return 0;
  14. }