Hey guys. I'm relatively new to programming in c++, could someone take a look at my source code, and steer me in the right direction here please.
This is what i'm trying to do.
1[s]). The program should to be able to read a text file with the records in it.(DID THAT[/s])
2). I want to search the records using strings in the text file (Haven't done this)
3) Also, to sort the records from highest to loweest using the decimal numbers or double in text file
//Here is the code
#include <iostream>
#include <fstream>
#include <string>
usingnamespace std;
//double hu;
//string
int main ()
{
string line;
ifstream myfile ("testfile.txt");
if (myfile.is_open())
{
while ( myfile.good() )
{
getline (myfile,line);
cout << line << endl;
}
myfile.close();
}
else cout << "Unable to open file";
char c;
cout<<"\n enter a character and enter to exit: ";
cin>>c;
return 0;
}