Ok I'm back with another problem im having.. I have a vector of casual staffmembers.. Each time i create a casual staffmember they are added into a vector named thecasuals.. To return a casual staffmembers staffID a function is created:

staffmember::get_staffid();

I need to be able to enter a staffmembers ID number, and then search the vector for the correct staffmember and print the staff members details.. I have ATTEMPTED this as follows in a function in my 'company' class..:

company::staffIDsearch(int ID);
 
casstart = thecasuals.begin();
casend = thecasuals.end();
 
for (casstart; casstart < casend; casstart++)
 {
     if (thecasuals[casstart].get_staffid() == ID)
      {
            cout << thecasuals[cassstart].get_name(); << "    " << thecasuals[casstart].wage();
        }
  }
}

i am getting errors all over the place and am not sure what to do.. I have received errors saying i need to define 'casstart' and 'casend' but im not sure what to put them as, eg, int, casual...

Plus im sure there are syntax errors in there as i cannot find much helpful info on vectors and i'm lost..

Any Help would be appreciated!!

Thanks..

Jay Jones

Recommended Answers

All 2 Replies

Plus im sure there are syntax errors in there as i cannot find much helpful info on vectors and i'm lost..

See if you can see anything useful here.

commented: Replyin quick.. Useful links.. Awesome.. Thanks mate!! +1

Thanks again for replying so quick wolf.. I realised my understanding of vectors was not going to reach it's requirements in time.. So i went back *a very long way* and worked it all out with arrays..

Now i have very minor issues, but i have completed enough to at least pass if worst comes to worst.. But i think i should work majority of it out.. Countdown begins.. I have:

20 Hoursish.. heh..

Thanks again.. :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.