Rearranging and Sorting C strings.

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2007
Posts: 1
Reputation: Fedien is an unknown quantity at this point 
Solved Threads: 0
Fedien Fedien is offline Offline
Newbie Poster

Rearranging and Sorting C strings.

 
0
  #1
Dec 17th, 2007
Hello, so I'm a student in college and I'm new with C++ and I'm trying to make this program that allows me to read in names from a file, first name then last name, in Cstrings. Then I have to change it so that the output is "lastname, firstname". There are 7 names but the program is supposed to work whether there are 7 names or 25 names.

The program also must sort all the names so that they are in alphabetical order, then print them to another file.

I am only allowed to use one array as well.

I've tried a couple different ways but no matter how I do it I just can't seem to get it to work. Anyone have any suggestions on the route I should take in order to get this done? For some reason this one is just perplexing me.... I'm probably just over thinking it but any assistance would be greatly appreciated.

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Rearranging and Sorting C strings.

 
0
  #2
Dec 17th, 2007
The first step would be to make sure you can just read the information in, then simply print it out again unmodified.

Then add your attempt at sorting the data.

Post what you tried, at the point you get stuck.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC