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. Which one is faster a fstream or FILE

Which one is faster a fstream or FILE

Scheduled Pinned Locked Moved Managed C++/CLI
c++question
5 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.
  • U Offline
    U Offline
    User 527726
    wrote on last edited by
    #1

    :-O Hi, I want to introduce Logs in my c++ program. which is faster fstream or 'c' language's FILE ? so that i can use in my logs. Thanx in adv. lokiz

    T N C 3 Replies Last reply
    0
    • U User 527726

      :-O Hi, I want to introduce Logs in my c++ program. which is faster fstream or 'c' language's FILE ? so that i can use in my logs. Thanx in adv. lokiz

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

      FILE is not a method but only a structure. so, it doesn't perform any action, and we cannot calculate a duration on it... i think you wanted to ask for fstream methods compared with C file handling functions (fopen(), fclose(), fread(), fwrite(), fprintf(), fscanf(), ...) insn't it ?


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      U 1 Reply Last reply
      0
      • T toxcct

        FILE is not a method but only a structure. so, it doesn't perform any action, and we cannot calculate a duration on it... i think you wanted to ask for fstream methods compared with C file handling functions (fopen(), fclose(), fread(), fwrite(), fprintf(), fscanf(), ...) insn't it ?


        TOXCCT >>> GEII power
        [toxcct][VisualCalc]

        U Offline
        U Offline
        User 527726
        wrote on last edited by
        #3

        yes TOX u r right. which is faster fstream methods or C file handling functions................ lokiz

        1 Reply Last reply
        0
        • U User 527726

          :-O Hi, I want to introduce Logs in my c++ program. which is faster fstream or 'c' language's FILE ? so that i can use in my logs. Thanx in adv. lokiz

          N Offline
          N Offline
          Nemanja Trifunovic
          wrote on last edited by
          #4

          C io library is faster. But if you want really fast IO, you should better use directly Windows API


          My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.

          1 Reply Last reply
          0
          • U User 527726

            :-O Hi, I want to introduce Logs in my c++ program. which is faster fstream or 'c' language's FILE ? so that i can use in my logs. Thanx in adv. lokiz

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

            You're asking the wrong question. FILE is C, fstream is C++. You should use C++ if your app is in C++, even if it takes a microsecond longer. Reasons - extensibility and ability to write good code. Christian Graus - Microsoft MVP - C++

            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