| | |
file handling
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2006
Posts: 147
Reputation:
Solved Threads: 20
peek basically reads the next available character without moving the file pointer.
for example if text file contains the following text
and if you execute the following psuedo Code
if you don't want to move your reading cursor and wants to check which character will be read next you should use peek.
for example if text file contains the following text
•
•
•
•
Hello, World
cpp Syntax (Toggle Plain Text)
int main () { // open stream. char v = f.peek(); // the below line will print 'H' but will not extract this character from stream. cout << v <<endl; }
Last edited by Laiq Ahmed; Aug 10th, 2009 at 6:10 am. Reason: add the code tag
•
•
Join Date: Jan 2008
Posts: 3,810
Reputation:
Solved Threads: 501
•
•
•
•
can u tell me from where I can get more information about file handling and the functions of it..
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.
![]() |
Similar Threads
- making file handling using visual basic 6.0 (Visual Basic 4 / 5 / 6)
- File Handling. Implimentation problem. (C)
- please give me a simple file handling program (C)
- File Handling (C)
- C File handling - search within file without reading content? (C++)
Other Threads in the C++ Forum
- Previous Thread: AnsiString in Functions
- Next Thread: I ran out of vector space?
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion count database delete deploy desktop developer directshow dll dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph homeworkhelp homeworkhelper iamthwee ifstream input int integer lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






