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. URGENT : strange error C4430 VS2005 with ostream

URGENT : strange error C4430 VS2005 with ostream

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiohelp
4 Posts 3 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.
  • A Offline
    A Offline
    AhmedOsamaMoh
    wrote on last edited by
    #1

    Dear all i have the following class header #include "stdafx.h" #include < iostream > using namespace std; class test { private: int n1; int n2; public: test(int n1,int n2); output(std::ostream& outs); }; VS 2005 display the following error error C4430: missing type specifier - int assumed. Note: C++ does not support default-int for output(std::ostream& outs); any tips i searched the net and i didn't find any solutions thanks all bye

    M 1 Reply Last reply
    0
    • A AhmedOsamaMoh

      Dear all i have the following class header #include "stdafx.h" #include < iostream > using namespace std; class test { private: int n1; int n2; public: test(int n1,int n2); output(std::ostream& outs); }; VS 2005 display the following error error C4430: missing type specifier - int assumed. Note: C++ does not support default-int for output(std::ostream& outs); any tips i searched the net and i didn't find any solutions thanks all bye

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      you have to have a return type for your class methods. Use void if there's no applicable type... class test { private: int n1; int n2; public: test(int n1,int n2); void output(std::ostream& outs); }; Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      A 1 Reply Last reply
      0
      • M Mark Salsbery

        you have to have a return type for your class methods. Use void if there's no applicable type... class test { private: int n1; int n2; public: test(int n1,int n2); void output(std::ostream& outs); }; Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        A Offline
        A Offline
        AhmedOsamaMoh
        wrote on last edited by
        #3

        more than 3 hours try to solve this problem and then at the end IT IS VOID LOL thanks alot

        L 1 Reply Last reply
        0
        • A AhmedOsamaMoh

          more than 3 hours try to solve this problem and then at the end IT IS VOID LOL thanks alot

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          Adore C++ wrote:

          more than 3 hours try to solve this problem

          Next time try this[^]... where the fourth entry is this[^] it should prove to be faster.

          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