Professional Documents
Culture Documents
Programming Fundamentals Lec 06
Programming Fundamentals Lec 06
Programming Fundamentals Lec 06
Fundamentals
Lecture 06
main ()
{
int i;
for (i=1; i<=30; i++)
{
if (i%5==0)
break;
cout<< i<< endl;
}
cout << “Program end”;
}
*Programming Fundamentals
File Handling in C++
*Files are used to store data in a storage device permanently.
*File handling provides a mechanism to store the output of a
program in a file and to perform various operations on it.
*In file handling we can perform following task using c++
code:
Create a file ( .doc, .csv, .ppt, .txt etc)
Save the output of program into required file
Display the content of file in c++ console window
Add content to existing file without effecting previous
stored data
*Programming Fundamentals
File Handling in C++