Thread: C++ question
View Single Post
  #1 (permalink)  
Old June 11th, 2008, 01:31 AM
Edward King Edward King is offline
Authorized User
 
Join Date: Jul 2003
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default C++ question

I have three C++ files,like follows:
/*Test.h*/
Code:
#include <iostream.h>
class Test{
public:
   Test();
};
/*Test.cpp*/
Code:
#include "Test.h"
Test::Test(){
   cout<<"Test called";
}
/*a.cpp*/
Code:
#include "Test.h"
int main(int argc, char* argv[])
{
   Test abc=new Test();
   return 0;
}
When I run a.cpp,it raise following error:
[C++ Error] a.cpp(4): E2034 Cannot convert 'Test *' to 'Test'

Why raise above error? How to correct my code?
Thanks

Reply With Quote