User deletion

I need to allow the user to delete a name from my array and I do not know how to do that. Any suggestions?

Use std::vector instead of an array.
Not quite sure how that works. So eliminate the array completely?
Yes. You can post your code for a more specific response
Based on your other thread:
1
2
3
4
5
6
7
8
9
struct People
{   std::string lname;
    std::string fname;	
};

std::vector<People>  myvector;

 // erase the 6th element
  myvector.erase (myvector.begin()+5);


See:
http://www.cplusplus.com/reference/vector/vector/
Last edited on
Topic archived. No new replies allowed.