Jump to content

Size matters in file handling ???

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Patrick

Patrick

    Programmer

  • Members
  • PipPipPipPip
  • 101 posts
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++?

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I'm not sure what you mean by your questions. Can you give us an example?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Guest_Jordan_*

Guest_Jordan_*
  • Guests
An example would help us better determine your problem/question.

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,720 posts
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.