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. fstream + vector

fstream + vector

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelpquestion
6 Posts 5 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
    aldo hexosa
    wrote on last edited by
    #1

    if i try to include fstream.h and vector.h like this #include #include some error occured, what should i do?

    S P 2 Replies Last reply
    0
    • A aldo hexosa

      if i try to include fstream.h and vector.h like this #include #include some error occured, what should i do?

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      The standard library include files don't end in ".h". Use #include <vector> instead, for example.

      Steve

      1 Reply Last reply
      0
      • A aldo hexosa

        if i try to include fstream.h and vector.h like this #include #include some error occured, what should i do?

        P Offline
        P Offline
        Programm3r
        wrote on last edited by
        #3

        Could you be more specific about the error that occurs? Cause, I don't agree with Steve about the .h .... I mean I use it all the time and it work ???? Sorry My bad Steve ... are you talking about the vector header file??? If you are ... my bad.

        The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

        L C 2 Replies Last reply
        0
        • P Programm3r

          Could you be more specific about the error that occurs? Cause, I don't agree with Steve about the .h .... I mean I use it all the time and it work ???? Sorry My bad Steve ... are you talking about the vector header file??? If you are ... my bad.

          The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

          L Offline
          L Offline
          Link2006
          wrote on last edited by
          #4

          Programm3r wrote:

          Could you be more specific about the error that occurs? Cause, I don't agree with Steve about the .h .... I mean I use it all the time and it work ????

          Steve is right, you shouldn't use .h with the standard C++ Library. Older compilers may ship with both fstream.h and fstream, but VS05 does not. Before C++ got standardized, C++ headers files were still like C headers, with .h extension. But the standard C++ put all those header files under std namespace, so they rename all of them without .h extension.

          P 1 Reply Last reply
          0
          • L Link2006

            Programm3r wrote:

            Could you be more specific about the error that occurs? Cause, I don't agree with Steve about the .h .... I mean I use it all the time and it work ????

            Steve is right, you shouldn't use .h with the standard C++ Library. Older compilers may ship with both fstream.h and fstream, but VS05 does not. Before C++ got standardized, C++ headers files were still like C headers, with .h extension. But the standard C++ put all those header files under std namespace, so they rename all of them without .h extension.

            P Offline
            P Offline
            Programm3r
            wrote on last edited by
            #5

            Like I said .... " My bad " .... :)

            The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

            1 Reply Last reply
            0
            • P Programm3r

              Could you be more specific about the error that occurs? Cause, I don't agree with Steve about the .h .... I mean I use it all the time and it work ???? Sorry My bad Steve ... are you talking about the vector header file??? If you are ... my bad.

              The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

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

              Programm3r wrote:

              Cause, I don't agree with Steve about the .h .... I mean I use it all the time and it work ????

              Then you don't have VS2005. The standard headers do not have .h, and the non standard headers are finally gone in VS2005.

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

              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