What imperfections of the code?
Thanks!Code:void MyClass(int a)
{
int *x = new int[a];
int *y = new int[a];
Bar(x, y);
delete [] x;
delete [] y;
}
Printable View
What imperfections of the code?
Thanks!Code:void MyClass(int a)
{
int *x = new int[a];
int *y = new int[a];
Bar(x, y);
delete [] x;
delete [] y;
}
I don't know. Why should there be something wrong with it?
Smells like homework. Think "exceptions".Quote:
What imperfections of the code?
Code:
void MyClass(int a)
{
int *x = new int[a];
int *y = new int[a];
Bar(x, y);
delete [] x;
delete [] y;
}
Thanks!
There is also a question of how descriptive the code is of what it does. What is x, y, .... ?
A function named 'MyClass'.
Well, that's all we are allowed to see. A function.