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; }
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".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'.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Last edited by Dae; 09-12-2009 at 08:15 AM.
Warning: Have doubt in anything I post.
GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101
Well, that's all we are allowed to see. A function.
Last edited by Mario F.; 09-12-2009 at 07:52 AM.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.