Important alert: (current site time 7/15/2013 4:44:45 PM EDT)
 

article

Beginners tutorial to file handling

Email
Submitted on: 9/14/2001 2:25:32 AM
By: Shahab Faruqi 
Level: Intermediate
User Rating: By 22 Users
Compatibility: C++ (general)
Views: 107962
(About the author)
 
     FILE HANDLING TUTORIAL FOR BEGINNERS ------------------------------------ This tutorial is intended who don't not a single thing about file handling in C++, one of the most important concepts of any type of programming. I intend to present this tutorial into 2 parts, but both these parts are independent of each other and you can start from any one. This part focuses on: ->How to create files, read and write to them. ->The logic behind many commonly used objects like cout and cin [Did you know that cout is actually an object!!] ->Build your own notepad, "my computer" et cetra. If any doubts persist you can freely sontact me at: shahab_faruqi@rediffmail.com Click on file handling.htm to start.
 
winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.


Other 26 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

3/21/2002 11:20:15 PMDoug

Best code ever! This really helped me alot. This stuff seems so easy, yet so hard to find elsewhere on the 'net.
(If this comment was disrespectful, please report it.)

 
1/2/2003 3:57:00 PM

Thanks, very useful
(If this comment was disrespectful, please report it.)

 
1/5/2003 12:38:13 PM

tnx this really is a great tutorial fro people strating with file handelings I learned a lot fro it
(If this comment was disrespectful, please report it.)

 
2/12/2003 12:36:42 AM

I liked this tutorial and found it very useful... Look forward to more of them.
(If this comment was disrespectful, please report it.)

 
5/1/2003 10:48:10 AMOR13

I had problems compiling "notepad.cpp":

notepad.cpp(14) : error C2065: 'textbackground' : undeclared identifier
notepad.cpp(15) : error C2065: 'textcolor' : undeclared identifier
notepad.cpp(17) : error C2065: 'clrscr' : undeclared identifier
notepad.cpp(19) : error C2065: '_setcursortype' : undeclared identifier
notepad.cpp(19) : error C2065: '_NOCURSOR' : undeclared identifier
notepad.cpp(22) : error C2065: 'gotoxy' : undeclared identifier
notepad.cpp(157) : error C2065: '_NORMALCURSOR' : undeclared identifier
notepad.cpp(283) : error C2360: initialization of 'ii' is skipped by 'case' label
notepad.cpp(195) : see declaration of 'ii'
notepad.cpp(328) : error C2065: 'wherex' : undeclared identifier
notepad.cpp(328) : error C2065: 'wherey' : undeclared identifier
Error executing cl.exe.
notepad.obj - 10 error(s), 0 warning(s)
(If this comment was disrespectful, please report it.)

 
5/15/2004 9:38:19 AM

Great stuff! helped me alot!
(If this comment was disrespectful, please report it.)

 
6/14/2004 1:43:27 PM

all errors are because u dont have the right conio.h and conio.c header and source file. download bloosheds dev-c++ ide, they have the one with all the functions ur looking for
(If this comment was disrespectful, please report it.)

 
3/9/2005 11:59:52 PM

Very, very good stuff. Helped me out A TON! Lots of fun, too!
(If this comment was disrespectful, please report it.)

 
8/3/2005 4:31:26 AMKapil K Jain

It seems that this article has been deleted from your site. If possible please send this to me as an attachment.
In particular, I am looking for code to handle multiple files.
Thanks

(If this comment was disrespectful, please report it.)

 
11/17/2006 4:28:06 AMroger

may i ask for, where to download the "bloosheds dev-c++ ide", as mention above? since my compiler show 10 errors...
(If this comment was disrespectful, please report it.)

 
12/12/2007 1:56:15 AMDonald Dominic B. Dela Cruz

i found your article very useful in my studies and i even shared it with my students.
I would be glad if you could help me find an algorithm and source code in C or C++ on how to compare the two bitmap files where the two mentioned BMP files are input.

Thnak you very much andf more power!!!!
(If this comment was disrespectful, please report it.)

 
12/12/2007 1:56:23 AMDonald Dominic B. Dela Cruz

i found your article very useful in my studies and i even shared it with my students.
I would be glad if you could help me find an algorithm and source code in C or C++ on how to compare the two bitmap files where the two mentioned BMP files are input.

Thnak you very much and more power!!!!
(If this comment was disrespectful, please report it.)

 
12/12/2007 1:56:31 AMDonald Dominic B. Dela Cruz

i found your article very useful in my studies and i even shared it with my students.
I would be glad if you could help me find an algorithm and source code in C or C++ on how to compare the two bitmap files where the two mentioned BMP files are input.

Thank you very much and more power!!!!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.