c++ reading text file

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2006
Posts: 6
Reputation: hellokitty88 is an unknown quantity at this point 
Solved Threads: 0
hellokitty88 hellokitty88 is offline Offline
Newbie Poster

c++ reading text file

 
0
  #1
Dec 19th, 2007
I am reading a text file from an input file. The problem is that when I cout the text to the screen not all of the original text file is showing. The text file is large, but I was wondering if there was any way I could possibly display all of it. Thanks!
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 464
Reputation: invisal is a jewel in the rough invisal is a jewel in the rough invisal is a jewel in the rough 
Solved Threads: 49
invisal's Avatar
invisal invisal is offline Offline
Posting Pro in Training

Re: c++ reading text file

 
0
  #2
Dec 19th, 2007
Originally Posted by hellokitty88 View Post
I am reading a text file from an input file. The problem is that when I cout the text to the screen not all of the original text file is showing. The text file is large, but I was wondering if there was any way I could possibly display all of it. Thanks!
It would be nice if you post your code here. Make sure you post it with code tag.
Yesterday is a history, tomorrow is a mystery, today is a gift.
Behind every smile is a tear.
Visal .In
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 176
Reputation: dubeyprateek is an unknown quantity at this point 
Solved Threads: 22
dubeyprateek's Avatar
dubeyprateek dubeyprateek is offline Offline
Junior Poster

Re: c++ reading text file

 
0
  #3
Dec 19th, 2007
Try this
It can help you.
I know I am. Therefore I am.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 4
Reputation: Uncle_John is an unknown quantity at this point 
Solved Threads: 0
Uncle_John Uncle_John is offline Offline
Newbie Poster

Re: c++ reading text file

 
0
  #4
Dec 20th, 2007
Use fread function, search the cplusplus site for more information, it think it's a part of cstdlib
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 514
Reputation: Jishnu will become famous soon enough Jishnu will become famous soon enough 
Solved Threads: 26
Jishnu's Avatar
Jishnu Jishnu is offline Offline
Posting Pro

Re: c++ reading text file

 
0
  #5
Dec 20th, 2007
The text file is large, but I was wondering if there was any way I could possibly display all of it.
The console screen consists of 80*25 characters. If your file size is greater than that, then you cannot display entire file at a time. What you can do is, display a part of it (say, x characters) and ask the user to enter some character after which you can display the next x characters in the file.

Hope this helped.
"You know you're a computer geek when you try to shoo a fly away from the monitor screen with your cursor. That just happened to me. It was scary." - Juuso Heimonen.

"The only truly secure computer is one buried in concrete, with the power turned off and the network cable cut." - Anonymous.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 4266 | Replies: 4
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC