Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
1 Commented Post
0 Endorsements
Ranked #37.0K
~405 People Reached
Favorite Forums
Favorite Tags
c++ x 5

2 Posted Topics

Member Avatar for jessemr
Member Avatar for cspivey

Try this : [code] #include<iostream> #include<string> #include<fstream> using namespace std; int main() { int ndatamax=100; string line[ndatamax],linetemp; int i=0; int ndata; ifstream myfile; myfile.open("data.txt"); if(myfile.is_open()) { while(!myfile.eof()) { getline(myfile,line[i]); i++; } } ndata=i-1; // One way for sorting for(i=0;i<ndata;i++) { for(int j=i+1;j<ndata;j++) if( line[i]>line[j]) { linetemp=line[i]; line[i]=line[j];line[j]=linetemp;} } // new …

Member Avatar for jusakman
0
149

The End.