Tuesday, July 10, 2007

Hi ,


I faced the problem in C++ class as follows :

error C2533: 'VideoQualityUtil::__ctor' : constructors not allowed a return type

VideoQualityUtil::VideoQualityUtil()
{
m_pVideoQualityTool = NULL;
m_pCsvWriter = NULL;
}
So I refered the MSDN documentation for the Error C2533.

MSDN documentation for Error C2533 :


'identifier' : constructors not allowed a return type

A constructor cannot a value or have a return type (not even a void return type).

The following sample generates C2533:

// C2533.cpp

class X

{

public:

X();

};


int X::X()

// try the following line instead

// X::X()

{ // C2533

}


int main()

{

}




Can U identify where my program failed ?....


Scroll to see the Answer ...


.

.

.



Answer :

Sometimes with the help of MSDN, we can't solve the errors...




I found where my code fails...I left the class as follows...




class VideoQualityUtil

{

}


we have to change it as follows :



class VideoQualityUtil

{

}

;

I missed the semi colon...

No comments: