c**********e 发帖数: 2007 | 1 using namespace std;
class CLASS
{
public:
CLASS(int x=0);
CLASS(double);
};
int x=0;
CLASS *array = new CLASS[x];
int main()
{
return 0;
} | c**********e 发帖数: 2007 | 2 The correct answer: No, it shows the correct way to allocate
an array of CLASS objects.
However, there is an error running the code. Any guru can tell why? | z****e 发帖数: 2024 | 3 what are you talking about?
you didn't provide any definition of the constructor so when you attempt to
realize an object, of course you can not because the compiler doesn't know
how to.
【在 c**********e 的大作中提到】 : The correct answer: No, it shows the correct way to allocate : an array of CLASS objects. : However, there is an error running the code. Any guru can tell why?
|
|