Is there any limit of size of a file in terms of words that can be used for file handling in C++. Does the size affect the amount of data that can be displayed on a single output page which is displayed when a program is being run in C++?
Size matters in file handling ???
Started by Patrick, Oct 07 2007 12:01 AM
3 replies to this topic
#1
Posted 07 October 2007 - 12:01 AM
|
|
|
#2
Posted 08 October 2007 - 08:28 AM
I'm not sure what you mean by your questions. Can you give us an example?
#3
Guest_Jordan_*
Posted 08 October 2007 - 02:01 PM
Guest_Jordan_*
An example would help us better determine your problem/question.
#4
Posted 08 October 2007 - 02:30 PM
If I read your post correctly, you want to know:
(a) What's the largest chunk of data that C++ can read from a file
(b) How much information can be displayed on one screen in a C++ console app.
Answers:
(a) There isn't really a limit; however, reading an entire file at once into a data structure isn't really a good idea. You have no way of knowing if the program is hanging or if fread is taking its sweet time dumping data from the file buffer into your buffer. If the read fails, you won't know where in the file it failed, and will be stuck with a single cryptic error message to find out why. Try breaking up the reads into smaller statements that can be debugged easily.
(b) Depends on the format of your data. More info would be nice.
(a) What's the largest chunk of data that C++ can read from a file
(b) How much information can be displayed on one screen in a C++ console app.
Answers:
(a) There isn't really a limit; however, reading an entire file at once into a data structure isn't really a good idea. You have no way of knowing if the program is hanging or if fread is taking its sweet time dumping data from the file buffer into your buffer. If the read fails, you won't know where in the file it failed, and will be stuck with a single cryptic error message to find out why. Try breaking up the reads into smaller statements that can be debugged easily.
(b) Depends on the format of your data. More info would be nice.


Sign In
Create Account


Back to top









