"return type may not be specified on a constructor"

I am getting this error in VS10. Here's my code: (the error appears on the word class)


class ComplexNum{
	double real;
	double imag;
	ComplexNum(double x, double y);
	ComplexNum operator+(ComplexNum x);
	ComplexNum operator-(ComplexNum x);
	ComplexNum operator*(ComplexNum x);

I also have a file ComplexNum.h which fleshes out those functions. Here is my function for the constructor:

ComplexNum::ComplexNum(double x, double y){
real = x;
imag = y;

I have a main.cpp file too.

Can anyone explain why I am getting the error:
"return type may not be specified on a constructor"


I forgot to put a ; at the end of the class

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.