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. Where's iostream?

Where's iostream?

Scheduled Pinned Locked Moved C / C++ / MFC
c++beta-testingquestion
11 Posts 8 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.
  • K Offline
    K Offline
    Kyle Bishop
    wrote on last edited by
    #1

    At my school, we're currently using visual C++ (sorry i said visual basic before by mistake). I recently downloaded the new beta versoin of VC++, and it doesn't seem to have iostream.h. I was wondering where I could find a good source for both iostream, and other libraries I may need in the future. =P

    T G L M T 5 Replies Last reply
    0
    • K Kyle Bishop

      At my school, we're currently using visual C++ (sorry i said visual basic before by mistake). I recently downloaded the new beta versoin of VC++, and it doesn't seem to have iostream.h. I was wondering where I could find a good source for both iostream, and other libraries I may need in the future. =P

      T Offline
      T Offline
      Tim Smith
      wrote on last edited by
      #2

      iostream is a C++ thing, not VB. Tim Smith I'm going to patent thought. I have yet to see any prior art.

      1 Reply Last reply
      0
      • K Kyle Bishop

        At my school, we're currently using visual C++ (sorry i said visual basic before by mistake). I recently downloaded the new beta versoin of VC++, and it doesn't seem to have iostream.h. I was wondering where I could find a good source for both iostream, and other libraries I may need in the future. =P

        G Offline
        G Offline
        Gerald Schwab
        wrote on last edited by
        #3

        Try iostream without the .h

        1 Reply Last reply
        0
        • K Kyle Bishop

          At my school, we're currently using visual C++ (sorry i said visual basic before by mistake). I recently downloaded the new beta versoin of VC++, and it doesn't seem to have iostream.h. I was wondering where I could find a good source for both iostream, and other libraries I may need in the future. =P

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          #include <iostream> without the ".h" it should work.

          K 1 Reply Last reply
          0
          • L Lost User

            #include <iostream> without the ".h" it should work.

            K Offline
            K Offline
            Kyle Bishop
            wrote on last edited by
            #5

            hmm, I'm not sure if my problem's linked, but I'm getting an unidentified identifier error when i try to use cout or endl. (while using #include ) It doesn't seem to effect my program wether or not I include iostream (without the .h) at all. ------------------------------- I'm also having trouble getting string to work. String Suit1 = "No suit", Suit2 = "No suit"; An error comes up when i run that code, saying I forgot a ; before suit1. and I'm getting syntax error: identifier 'String' whenever it's used in the program other then the initial delaraction of the variables Suit1 and Suit2. I have #include string.h (with arrows, the post acts weird if i put them in) and there seems to be no problems with it, and I've run similar code on VC 6 with no problem. ------------------------------- Am I doing something wrong, or is there a problem with my libraries? =P

            C 1 Reply Last reply
            0
            • K Kyle Bishop

              hmm, I'm not sure if my problem's linked, but I'm getting an unidentified identifier error when i try to use cout or endl. (while using #include ) It doesn't seem to effect my program wether or not I include iostream (without the .h) at all. ------------------------------- I'm also having trouble getting string to work. String Suit1 = "No suit", Suit2 = "No suit"; An error comes up when i run that code, saying I forgot a ; before suit1. and I'm getting syntax error: identifier 'String' whenever it's used in the program other then the initial delaraction of the variables Suit1 and Suit2. I have #include string.h (with arrows, the post acts weird if i put them in) and there seems to be no problems with it, and I've run similar code on VC 6 with no problem. ------------------------------- Am I doing something wrong, or is there a problem with my libraries? =P

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              OK. Here's your problem. When the C++ standard was introduced, one thing that was added was namespaces. The standard libraries were placed in namespace std, and the headers that end in .h were deprecated ( i.e. most compilers have them, but they are not standard, they are not part of C++ as define by X3J16 ). So, to use the string class, for example, you must #include. BUT, by doing this, you make part of namespace std visible, which will not give you access to the string class unless you do one of these: using namespace std; // This is really bad, it includes everything in std, i.e. a lot of stuff you don't know about, and which could change in future compilers using std::string; // much better, drag the string class alone ( well, and any iostream operators, but that's another story ) into the global namespace or, in your code: std::string myString; // best of all in terms of segmentation of namespaces, but a bit cumbersome, I'd use it only for things I am only going to define once or twice. Also, String with a capital S is wrong. The string class is all lower case. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

              K 1 Reply Last reply
              0
              • C Christian Graus

                OK. Here's your problem. When the C++ standard was introduced, one thing that was added was namespaces. The standard libraries were placed in namespace std, and the headers that end in .h were deprecated ( i.e. most compilers have them, but they are not standard, they are not part of C++ as define by X3J16 ). So, to use the string class, for example, you must #include. BUT, by doing this, you make part of namespace std visible, which will not give you access to the string class unless you do one of these: using namespace std; // This is really bad, it includes everything in std, i.e. a lot of stuff you don't know about, and which could change in future compilers using std::string; // much better, drag the string class alone ( well, and any iostream operators, but that's another story ) into the global namespace or, in your code: std::string myString; // best of all in terms of segmentation of namespaces, but a bit cumbersome, I'd use it only for things I am only going to define once or twice. Also, String with a capital S is wrong. The string class is all lower case. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                K Offline
                K Offline
                Kyle Bishop
                wrote on last edited by
                #7

                Thanks a ton, that cleared a lot of stuff up. That seems strange that my school is teaching me outdated material (damn budget). Anyways, I'm still a little confused as to what I do to use cout or endl. Are there replacements, are they in std, etc.? =P

                C 1 Reply Last reply
                0
                • K Kyle Bishop

                  Thanks a ton, that cleared a lot of stuff up. That seems strange that my school is teaching me outdated material (damn budget). Anyways, I'm still a little confused as to what I do to use cout or endl. Are there replacements, are they in std, etc.? =P

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  Kyle Bishop wrote: That seems strange that my school is teaching me outdated material (damn budget). The problem is rarely the budget, it's that teachers are probably a bunch of old C hackers who actually don't know any better. Kyle Bishop wrote: Anyways, I'm still a little confused as to what I do to use cout or endl. Are there replacements, are they in std, etc.? Yes, the standard headers contain the same stuff, they are just in std. So, to extend my example: #include <iostream> using std::cout; using std::endl; will give you what you're after. As an aside, don't overuse endl, it does more than send a /r/n, it also flushes the stream, so if you use it in tight loops, performance will suffer. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

                  1 Reply Last reply
                  0
                  • K Kyle Bishop

                    At my school, we're currently using visual C++ (sorry i said visual basic before by mistake). I recently downloaded the new beta versoin of VC++, and it doesn't seem to have iostream.h. I was wondering where I could find a good source for both iostream, and other libraries I may need in the future. =P

                    M Offline
                    M Offline
                    Michael Dunn
                    wrote on last edited by
                    #9

                    Check out the VC forum FAQ: 2.1 I'm trying to use a standard C++ library class (like cout, cin, or string) but the compiler gives an undeclared identifier error (C2065) on those names. Why?[^] --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb Magnae clunes mihi placent, nec possum de hac re mentiri.

                    1 Reply Last reply
                    0
                    • K Kyle Bishop

                      At my school, we're currently using visual C++ (sorry i said visual basic before by mistake). I recently downloaded the new beta versoin of VC++, and it doesn't seem to have iostream.h. I was wondering where I could find a good source for both iostream, and other libraries I may need in the future. =P

                      T Offline
                      T Offline
                      thompsons
                      wrote on last edited by
                      #10

                      Kyle, I don't know if you are using VC++ 6.0 or .net. I also had a similar problem when porting VC++ 6.0 code to 2003 .net. Some kind soul informed me that I should use "iostream" instead of "iostream.h" and it worked! Somehow, MicroSoft dropped the ".h" in later releases of the compiler in this case. Good Luck.

                      A 1 Reply Last reply
                      0
                      • T thompsons

                        Kyle, I don't know if you are using VC++ 6.0 or .net. I also had a similar problem when porting VC++ 6.0 code to 2003 .net. Some kind soul informed me that I should use "iostream" instead of "iostream.h" and it worked! Somehow, MicroSoft dropped the ".h" in later releases of the compiler in this case. Good Luck.

                        A Offline
                        A Offline
                        Aamir Butt
                        wrote on last edited by
                        #11

                        thompsons wrote: Somehow, MicroSoft dropped the ".h" in later releases of the compiler in this case. This is not the case. In fact, when you are using iostream without .h and in angle brackets, you are using STL's iostream. Microsoft dropped support for streams when they first came up with Visual C++.NET Found on Bash.org I'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet My Articles

                        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