我用visual c++建立一个Win32 Console Application,
有一个Test.cpp和Test.h文件
Test.h代码如下:#ifndef _MY_ARRAY_
#define _MY_ARRAY_
class MyArray
{
    public:
   MyArray(int size);
   ~MyArray();
    private:
   int _size;
   int* h;
}
#endifTest.cpp代码如下:#include "stdafx.h"
#include "Test.h"MyArray::MyArray(int size)
{                              //错误点1
    _size = size;
int  i = 0;
h = new int[_size]; for(; i < size; i++)
{
*(h+i) = i;
}
}
MyArray::~MyArray()
{
}
int main(int argc, char* argv[])
{
    MyArray myTestArray(10);     //错误点2
    return 0;
}编译的时候,系统提示
错误点1
error C2533: 'MyArray::MyArray' : constructors not allowed a return type
错误点2
error C2264: 'MyArray::MyArray' : error in function definition or declaration; function not called
请各位前辈指点