Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Issue in porting code from VS6.0 to VS2008 [modified]

Issue in porting code from VS6.0 to VS2008 [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nandu_77b
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • N Nandu_77b

      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

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      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

      N 1 Reply Last reply
      0
      • S Stuart Dootson

        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

        N Offline
        N Offline
        Nandu_77b
        wrote on last edited by
        #3

        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

        S 1 Reply Last reply
        0
        • N Nandu_77b

          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

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups