struct BUFF
{
int * a;
int * b;
int * ...;
};
main() {
BUFF buff;
buff.a = new int[32];
buff.b = new int[32];
buff.... = new int[32];
// какие-то действия ...
// освобождение памяти
delete[] buff.a;
delete[] buff.b;
delete[] buff.....;
}
struct BUFF
{
int * a;
int * b;
int * ...;
BUFF();
~BUFF();
};
BUFF::BUFF()
{
a = new int[32];
b = new int[32];
.... = new int[32];
}
BUFF::~BUFF()
{
delete[] a;
delete[] b;
delete[] ...;
}
struct BUFF
{
int * abc[3];
};
for (int i = 0; i < 3; ++i)
{
delete[] buff.abc[i];
}