Multiple file line reading program (part 3).
Program body
#include iostream
#include string
#include fstream
using namespace std;
int main (){
ifstream file;
file.open("izuna.txt");
if(!file.is_open()){
cout<<"unable to load the file please check the directory"<<endl;
}else {
cout<<"File opened successfully!"<<endl;
string lines;
while(file.good()){
getline(file,lines);
cout<<lines<<endl;
}
}
return 0;
}
Working of program
this is multiple lines reading program of C++ in codeblocks!
When you have the text file in that directory than this program will be executed else its gonna give, "unable to load the file please check the directory".
I hope you enjoyed and will learn more in future from
@learnandgrow
Leave Multiple file line reading program (part 3). to:
Read more #programming posts
Best Posts From Emperor Sabi
We have not curated any of learnandgrow's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Emperor Sabi
- Thursday freewrite__ Prompt: cityscape
- ZapFic Monday - Prompt: engagement in 240 character or less
- Poser Pro 11 - Discover the Art of the Human Form with Poser
- YELLOW PAGES SPIDER - GET THOUSANDS OF LEADS ON DEMAND
- MindGenius Business - Creating complex business idea maps, strategies,plans & more
- Quickbooks Pro - software for managing businesses effectively and efficiently
- Autodesk Revit MEP - Best for designing 2D structural and 3D model of a building
- eDrawings Professional - The Easiest Way to Share 3D Data Across CAD Environments
- GiftedMotion - GiftedMotion is a free and easy & open source GIF animator
- Blumentals WeBuilder - fast, intelligent & all in one code editor for web developer