Flexible array members and Zero extent arrays.

As these are dynamically created at runtime, Do you need to delete these constructs to stop memory leaks? and if so, do you just delete the declared struct? Or is it done in some other manner?

1
2
3
4
5
6
7
8
9
10
11
struct Foo{
   int a;
   int b[];
}; 

struct Foo foo1 = { 69, {1, 2, 3} };

// done with it's uses

delete foo1;


1
2
3
4
5
6
7
8
struct foo{
   int a;
   char b[0];
}; foo2 = { 100, { } };

// as above?

delete foo2;
Last edited on
There's no problem of memory leaks since it shouldn't compile
Bazzy wrote:
There's no problem of memory leaks since it shouldn't compile


That's the last time I read the IBM tutorials...
Topic archived. No new replies allowed.