Issue in porting code from VS6.0 to VS2008 [modified]
-
Hi, class Client; Client(const Client&); The above code compiles fine with VSC++6.0, when same is compiled with VSC++ 2008 throw’s the following is the compilation error "error C4430: missing type specifier - int assumed. Note: C++ does not support default-int" Then I have changed the code as below, it got compiled with VSC++ 2008. Client(const &Client); So can any one help me what is the cause of the problem and whether this "Client(const &Client); " is correct approach. Thanks, Nandu
modified on Friday, September 18, 2009 7:48 AM
-
Hi, class Client; Client(const Client&); The above code compiles fine with VSC++6.0, when same is compiled with VSC++ 2008 throw’s the following is the compilation error "error C4430: missing type specifier - int assumed. Note: C++ does not support default-int" Then I have changed the code as below, it got compiled with VSC++ 2008. Client(const &Client); So can any one help me what is the cause of the problem and whether this "Client(const &Client); " is correct approach. Thanks, Nandu
modified on Friday, September 18, 2009 7:48 AM
What is that code even meant to mean? You've forward declared a class (Client), then what looks a bit like a constructor for that class. Doesn't make sense. Oh - and VS2008 is complaining because you haven't specified a return type for what looks like a function declaration of a function called Client.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
What is that code even meant to mean? You've forward declared a class (Client), then what looks a bit like a constructor for that class. Doesn't make sense. Oh - and VS2008 is complaining because you haven't specified a return type for what looks like a function declaration of a function called Client.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Thanks, I got the answer. In VS6.0 Client(const &Client); compiles fine, where as in VS2008 it throws compilation error. For VS2008 it should be Client(const Client&); - For copy con -Nandu
So…lets look at the code you posted:
class Client;
Client(const Client&);and what (judging by your answer) you should have posted:
class Client
{
Client(const &Client);
};Your original code was syntactically incorrect and at the same time had the syntax (const Client&) that you now report as fixing the problem. If you're going to post problems with a code snippet, at least make it an accurate code snippet...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p