HI Guys,
i am trying to develop a c++ programm, that accept a path to a .txt file from the user to read it, make it lowercase, sort it and give the output in the concole. and some other functions later...
Now my problem is, that i dont know how to put my text from the string into an Array and make a lowercase function for it, and at least give the output in the console.
Thas my code:
#include <iostream>
#include <fstream>
#include <string>
#include <conio.h>
using namespace std;
int main(int argc, char* argv[])
{
string line;
string path;
cout<<"here is the input of the path:\n\n";
cin>>path;
getchar();
ifstream myfile (path.c_str());
if (myfile.is_open())
{
while( getline( myfile, line)){
cout<<""<<endl;
cout << line << endl;
}
myfile.close();
}
else cout << "Unable to open file";
getchar();
return 0;
}