User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 375,227 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,215 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:

C++ Bubble sort not working with array of records, does work with simple array.

Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,199
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 34
Solved Threads: 824
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: C++ Bubble sort not working with array of records, does work with simple array.

  #9  
May 9th, 2008
Would you also post the input files? Just attach them to your post .

Here is what I had in mind for the structure, but I need the input files for testing.

struct if1
{
  string idnum;//id number for the student
  string lastname;//last name of student
  string firstname;//first name of student
  int examscore[maxexam];//array of all the exam scores of the student
  int hwscore[maxhw];//array of all the home work scores of the student

  void operator=(if1& f1)
  {
      idnum = f1.idnum;
      lastname = f1.lastname;
      firstname = f1.firstname;
      memcpy(examscore, f1.examscore, sizeof(examscore));
      memcpy(hwscore,f1.hwscore,sizeof(hwscore));
  }
};
'Politics' is made up of two words, 'poli,' which is Greek for 'many,' and 'tics,' which are blood-sucking insects.
- Gore Vidal
Being ignorant is not so much a shame as being unwilling to learn. - Benjamin Franklin
Reply With Quote  
All times are GMT -4. The time now is 3:52 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC