file handling

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2009
Posts: 25
Reputation: sara khan is an unknown quantity at this point 
Solved Threads: 0
sara khan sara khan is offline Offline
Light Poster

file handling

 
0
  #1
Aug 10th, 2009
Hello..,,
I have read about a function used in file handling named as "peek".
If anyone knows about this function then plz tell me.....
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 106
Reputation: jen140 is an unknown quantity at this point 
Solved Threads: 5
jen140 jen140 is offline Offline
Junior Poster

Re: file handling

 
0
  #2
Aug 10th, 2009
I've found 4 functions with start "Peek" (and they was found at win32.hlp, that you could find with google), that are:
PeekConsoleInput
PeekMessage
PeekNamedPipe
PeekPenInput
Searching on msdn will give you the required information, hope it helps =).
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 147
Reputation: Laiq Ahmed will become famous soon enough Laiq Ahmed will become famous soon enough 
Solved Threads: 20
Laiq Ahmed Laiq Ahmed is offline Offline
Junior Poster

Re: file handling

 
0
  #3
Aug 10th, 2009
peek basically reads the next available character without moving the file pointer.

for example if text file contains the following text
Hello, World
and if you execute the following psuedo Code
  1. int main ()
  2. {
  3. // open stream.
  4. char v = f.peek();
  5.  
  6. // the below line will print 'H' but will not extract this character from stream.
  7. cout << v <<endl;
  8. }
if you don't want to move your reading cursor and wants to check which character will be read next you should use peek.
Last edited by Laiq Ahmed; Aug 10th, 2009 at 6:10 am. Reason: add the code tag
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 25
Reputation: sara khan is an unknown quantity at this point 
Solved Threads: 0
sara khan sara khan is offline Offline
Light Poster

Re: file handling

 
0
  #4
Aug 10th, 2009
can u tell me from where I can get more information about file handling and the functions of it..
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,810
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 501
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: file handling

 
0
  #5
Aug 10th, 2009
Originally Posted by sara khan View Post
can u tell me from where I can get more information about file handling and the functions of it..
Google it! "C++ peek" gives the following as the first link.

http://www.cplusplus.com/reference/i.../istream/peek/

Bookmark the entire site.

http://www.cplusplus.com

It's your first stop before you ask a question on a forum. Type what you are asking about in its search engine. It has all the functions and all the libraries and examples. And a tutorial section.

http://www.cplusplus.com/doc/tutorial/

Bookmark that too.

Scroll down till you get to the "Input/Output With Files" section.

http://www.cplusplus.com/doc/tutorial/files/

If you don't like this site, type "C++ tutorial" into google or Daniweb or wherever. You need to do all of this before posting.
Reply With Quote Quick reply to this message  
Reply

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


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC