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. open a file in binary mode

open a file in binary mode

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
7 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.
  • V Offline
    V Offline
    V_shr
    wrote on last edited by
    #1

    Hello I want to open a file in binary mode in Turbo C++ , by using fopen() and i need help thank you

    C T V V 4 Replies Last reply
    0
    • V V_shr

      Hello I want to open a file in binary mode in Turbo C++ , by using fopen() and i need help thank you

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      V_shr wrote:

      I want to open a file in binary mode in Turbo C++ , by using fopen()

      :doh: What are you trying to do ? Could you be more specific ? If you want to 'open the file in binary mode', you can simply add the flag "b" when calling fopen. But I doubt this is what you are looking for.


      Cédric Moonen Software developer
      Charting control

      V 1 Reply Last reply
      0
      • V V_shr

        Hello I want to open a file in binary mode in Turbo C++ , by using fopen() and i need help thank you

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

        have you only look the fopen() doc[^] ??

        fopen("file.dat", "ba+");


        TOXCCT >>> GEII power

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

        1 Reply Last reply
        0
        • C Cedric Moonen

          V_shr wrote:

          I want to open a file in binary mode in Turbo C++ , by using fopen()

          :doh: What are you trying to do ? Could you be more specific ? If you want to 'open the file in binary mode', you can simply add the flag "b" when calling fopen. But I doubt this is what you are looking for.


          Cédric Moonen Software developer
          Charting control

          V Offline
          V Offline
          V_shr
          wrote on last edited by
          #4

          do you mean that i can write : fopen(adress,"br"); ??

          C 1 Reply Last reply
          0
          • V V_shr

            Hello I want to open a file in binary mode in Turbo C++ , by using fopen() and i need help thank you

            V Offline
            V Offline
            V_shr
            wrote on last edited by
            #5

            thanks

            1 Reply Last reply
            0
            • V V_shr

              Hello I want to open a file in binary mode in Turbo C++ , by using fopen() and i need help thank you

              V Offline
              V Offline
              Viorel
              wrote on last edited by
              #6

              Try

                  FILE * file = fopen(file_name, "rb");
              

              The key issue is the "b" flag.

              1 Reply Last reply
              0
              • V V_shr

                do you mean that i can write : fopen(adress,"br"); ??

                C Offline
                C Offline
                Cedric Moonen
                wrote on last edited by
                #7

                V_shr wrote:

                do you mean that i can write : fopen(adress,"br");

                Yes but what is adress ? It should be a char array that contains the path to the file. But you didn't answer my question: what are you trying to do exactly ? I think binary mode is not what you think it is.


                Cédric Moonen Software developer
                Charting control

                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