Which one is faster a fstream or FILE
-
:-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
-
:-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
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] -
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]yes TOX u r right. which is faster fstream methods or C file handling functions................ lokiz
-
:-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 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.
-
:-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
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++