C++ vs MFC
-
While I have library function from C, C++ and MFC, which one I should use. Say for Example, fOpen like APIs from C, IoStream like supplied function from C++ or MFC's CFile supplied one. Which one is best choice when want to to a heavy text processing [Searching for some tags in a 2-3 MB file, preparing a report].
-
While I have library function from C, C++ and MFC, which one I should use. Say for Example, fOpen like APIs from C, IoStream like supplied function from C++ or MFC's CFile supplied one. Which one is best choice when want to to a heavy text processing [Searching for some tags in a 2-3 MB file, preparing a report].
With file sizes of a few MB you can load the complete file into memory for parsing. Then you will not have significant differences in load time using different methods. I general the high level file interfaces will call the low level functions internally. So using the low level functions may be faster. But the overhead of the high level functions does not care much because the disk access usually consumes much more time than the execution of some more code.
-
While I have library function from C, C++ and MFC, which one I should use. Say for Example, fOpen like APIs from C, IoStream like supplied function from C++ or MFC's CFile supplied one. Which one is best choice when want to to a heavy text processing [Searching for some tags in a 2-3 MB file, preparing a report].
The right tool for the right job, of course. For instance: if you are developing a
MFC
application the it make sense usingMFC
supplied objects (with several caveats, e.g.C++ STL
containers are much better thanMFC
ones). On the other hand, if portability is a concern then you better useC
functions orC++
objects. Even personal taste, matters. I often chooseC
-like (stdio
) functions instead ofC++
(iostream) objects.Veni, vidi, vici.