The inputData function has no return type(it probably should be void, since the prototype is). Also the constructor is not a member of this. Rather than trying to call the constructor you should probably have that code in a private function and call that instead.