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. Managed C++/CLI
  4. Cin and Cout- Class or object

Cin and Cout- Class or object

Scheduled Pinned Locked Moved Managed C++/CLI
c++
6 Posts 4 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.
  • S Offline
    S Offline
    Shamnar
    wrote on last edited by
    #1

    hi friends, i am infront of you with another doubt. We are using cin and cout in C++. Whether these are class or object. if they are object how can we use them without declaring that it belongs to this class. Thanks for u in advance. Shamnar:confused:

    shamnar

    N T G 3 Replies Last reply
    0
    • S Shamnar

      hi friends, i am infront of you with another doubt. We are using cin and cout in C++. Whether these are class or object. if they are object how can we use them without declaring that it belongs to this class. Thanks for u in advance. Shamnar:confused:

      shamnar

      N Offline
      N Offline
      NrmMyth
      wrote on last edited by
      #2

      cin is a class... well how do you percept a difference between class and object?

      T 1 Reply Last reply
      0
      • N NrmMyth

        cin is a class... well how do you percept a difference between class and object?

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        NrmMyth wrote:

        cin is a class

        no, cin is an instance of a class (std::ofstream class). the difference between a class and an object is that a class defines a type, while an object is an instance of that class (an instance of the type of the class)


        TOXCCT >>> GEII power

        [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

        N 1 Reply Last reply
        0
        • S Shamnar

          hi friends, i am infront of you with another doubt. We are using cin and cout in C++. Whether these are class or object. if they are object how can we use them without declaring that it belongs to this class. Thanks for u in advance. Shamnar:confused:

          shamnar

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          well, i not only don't understand what you mean, but for the second time, i tell you that you ask about UNMANAGED C++, in a Managed C++ forum... this is the wrong place ! BTW, see my reply to the other guy to get some infos. the point is that cout and cin are instanciated at the beginning of your program (implicitely)


          TOXCCT >>> GEII power

          [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

          1 Reply Last reply
          0
          • T toxcct

            NrmMyth wrote:

            cin is a class

            no, cin is an instance of a class (std::ofstream class). the difference between a class and an object is that a class defines a type, while an object is an instance of that class (an instance of the type of the class)


            TOXCCT >>> GEII power

            [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

            N Offline
            N Offline
            NrmMyth
            wrote on last edited by
            #5

            my bad, weren't thinking also, i never used word "object" for "instance", personal opinion

            1 Reply Last reply
            0
            • S Shamnar

              hi friends, i am infront of you with another doubt. We are using cin and cout in C++. Whether these are class or object. if they are object how can we use them without declaring that it belongs to this class. Thanks for u in advance. Shamnar:confused:

              shamnar

              G Offline
              G Offline
              gdoupanguoqing
              wrote on last edited by
              #6

              cin and cout aren't class or object. They are both functions. we can use them without declaring because they have been declared in iostream.h -- modified at 2:53 Sunday 13th August, 2006 -- modified at 2:55 Sunday 13th August, 2006

              I love this web

              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